Thursday, July 30, 2009

Unix Question?

How, in unix, can I convert a time expressed in seconds from epoch to a normal date/time?

Unix Question?
Use localtime() function.





http://www.opengroup.org/onlinepubs/0000...





For example:


....


char timestring[60];


time_t t = time(NULL);


strftime(timestring, sizeof(timestring), "%Y-%m-%d %H:%M:%S", localtime(%26amp;t));

fresh flower

No comments:

Post a Comment