#include <time.h>
size_t strftime ( String, Length, Format, TmDate)
char *String;
size_t Length;
const char *Format;
const struct tm *TmDate;
The strftime subroutine converts the internal time and date specification of the tm structure, which is pointed to by the TmDate parameter, into a character string pointed to by the String parameter under the direction of the format string pointed to by the Format parameter. The actual values for the format specifiers are dependent on the current settings for the LC_TIME category. The tm structure values may be assigned by the user or generated by the localtime or gmtime subroutine. The resulting string is similar to the result of the printf Format parameter, and is placed in the memory location addressed by the String parameter. The maximum length of the string is determined by the Length parameter and terminates with a null character.
Many conversion specifications are the same as those used by the date command. The interpretation of some conversion specifications is dependent on the current locale of the process.
The Format parameter is a character string containing two types of objects: plain characters that are simply placed in the output string, and conversion specifications that convert information from the TmDate parameter into readable form in the output string. Each conversion specification is a sequence of this form:
% type
Some conversion specifiers can be
modified by the E or O modifier characters to indicate
that an alternative format or specification should be used. If the
alternative format or specification does not exist for the current locale, the
behavior will be the same as with the unmodified conversion
specification. The following modified conversion specifiers are
supported:
If the total number of resulting bytes, including the terminating null byte, is not more than the Length value, the strftime subroutine returns the number of bytes placed into the array pointed to by the String parameter, not including the terminating null byte . Otherwise, a value of 0 is returned and the contents of the array are indeterminate.
This subroutine is part of Base Operating System (BOS) Runtime.
The localtime subroutine, gmtime subroutine, mbstowcs subroutine, printf subroutine, strfmon (strfmon Subroutine) subroutine, strptime (strptime Subroutine) subroutine, wcsftime (wcsftime Subroutine) subroutine.
The date command.
LC_TIME Category for the Locale Definition Source File Format in AIX 5L Version 5.1 Files Reference.
List of Time Data Manipulation Services in AIX 5L Version 5.1 System Management Concepts: Operating System and Devices.
National Language Support Overview for Programming, Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.