Skip to main content

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.

Comments