My Tech notes: strftime - format date and time
Subscribe

Unix Documentation

Free Online Unix Training Materials

Lists many links to free Unix training materials.

Pointers and Arrays Materials

Pointers and Arrays materials Explained for C beginners

C FAQ and General Questions C Interview Questions

Powered By

Free XML Skins for Blogger

Powered by Blogger

Sunday, August 24, 2008

strftime - format date and time


strftime - format date and time
#include

size_t strftime(char *s, size_t max, const char *format,
const struct tm *tm);
The strftime() function formats the broken-down time tm according to the format specifica-
tion format and places the result in the character array s of size max.

The strftime() function returns the number of characters placed in the array s, not
including the terminating NUL character, provided the string, including the terminating
NUL, fits. Otherwise, it returns 0, and the contents of the array is undefined.
Note that the return value 0 does not necessarily indicate an error; for example, in many
locales %p yields an empty string.
For more details check man pages.

No comments:

Post a Comment