|
||
size_t strftime(char *s, size_t n, char *fmt, struct tm *tp)
char *s; /* character buffer to receive formatted time string */ size_t n; /* maximum count of characters to store */ char *fmt; /* format string */ struct tm *tp; /* address of time structure */
|
|
|||||||||||||||||||||||||||||||||||||||||||||||
Synopsis |
#include "time.h"
The strftime function formats the time represented by the struct tm pointer tp into the character buffer pointed to by s , under control of the format string fmt . No more than n characters are stored in s , including the null-terminator.
|
|
||||||||||||||||||||||||||||||||||||||||||||||
Parameters |
s is a character buffer that is to receive the formatted time string. n is an integer specifying the maximum number of characters to be stored into s . tp is the address of a struct tm containing a time representation. fmt is a null-terminated string containing ordinary characters and conversion specifications. Ordinary characters are copied unmodified into s ; conversion specifiers are replaced as described below.
A conversion specification is a '%' character followed by a conversion character. The conversion specifications are the following:
|
|
||||||||||||||||||||||||||||||||||||||||||||||
Return Value |
strftime returns the number of characters stored in s , if less than n ; otherwise, if the string would be larger than n , strftime returns 0.
|
|
||||||||||||||||||||||||||||||||||||||||||||||
See Also |
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
|