localtime

Tod listacctc@gmail.com
Wed Jun 15 17:23:00 GMT 2011


On 06/15/2011 11:26 AM, Tod wrote:
> Hi,
>
> Has anything change in regards to the C localtime function since 2007?
> I've got a program with a function that uses it to present the date and
> time that I just changed. The time isn't appearing only the date.
>
> No errors, no dumps, just no time. Most bizarre.
>
>
> TIA - Tod


Incidentally, here's how I'm valuing the time.  Worked with the 2007 
version of cygwin1.dll (not that I'm blaming cygwin):

char * getTime(char *tout)
    {
     time_t      now;
     struct      tm tim;

     now = time(NULL);
     tim = *(localtime(&now));
     strftime(tout,strlen(tout),"%m/%d/%Y:%H:%M:%S",&tim);

     return(tout);
    }

tout is a 128 byte character array.

Thanks.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list