SYNOPSIS #include <time.h> size_t strftime(char *s, size_t maxsize, const char *format, const struct tm *timp);DESCRIPTION
You control the format of the output using the string at format. *format can contain two kinds of specifications: text to be copied literally into the formatted string, and time conversion specifications.
Time conversion specifications
are two-character sequences beginning with %
(use %%
to include a percent sign in the output). Each defined conversion specification
selects a field of calendar time data from *timp,
and converts it to a string in one of the following ways.
|
|
|
|
|
|
|
|
|
|
Mon Apr 01 13:13:13 1992
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mon Apr 01 1992
|
|
13:13:13
|
|
|
|
|
|
|
|
RETURNS
When the formatted time
takes up no more than maxsize
characters, the result is the length
of the formatted string. Otherwise, if the formatting operation was abandoned
due to lack of room, the result is 0,
and the string starting at s
corresponds to just those parts of
*format
that could be completely filled in
within the maxsize
limit.
COMPLIANCE
ANSI C requires strftime,
although it does not specify the contents of *s
when the formatted
string would require more than maxsize
characters.
strftime requires no supporting OS subroutines.