Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (s) strftime(3)
NAME
strftime - Converts a date and time to a string
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <time.h>
size_t strftime(
char *s,
size_t maxsize,
const char *format,
const struct tm *timeptr);
PARAMETERS
s Points to the array that contains the output date and time string.
maxsize Specifies the maximum number of bytes to be written to the array pointed to by
the s parameter.
format Points to a sequence of format codes that specify the format of the date and time
to be written to the output string. (See the DESCRIPTION section for more
information.)
timeptr Points to a type tm structure that contains broken-down time information.
DESCRIPTION
The strftime() function places characters into the array pointed to by the s parameter as con-
trolled by the string pointed to by the format parameter. The string pointed to by the format
parameter is a multibyte character sequence.
Local time zone information is used as though the strftime( ) function called the tzset( ) function.
Time information used in this subroutine is fetched from space that contains the type tm struc-
ture data, which is defined in the time.h header file. The type tm structure must contain the time
information used by this subroutine to construct the time and date string.
The format string consists of zero or more conversion specifications and ordinary multibyte char-
acters. A conversion specification consists of a % (percent sign) character followed by a charac-
ter that determines how the conversion specification constructs the formatted string.
All ordinary multibyte characters, including the terminating null character, are copied unchanged
into the s array. When copying between objects that overlap, behavior of this function is
undefined. No more than the number of bytes specified by the maxsize parameter are written to
the array, including the terminating null byte. Each conversion specification is replaced by the
appropriate characters as described in the following list. The appropriate characters are deter-
mined by the LC_TIME category of the current locale and by values specified by the type tm
structure pointed to by the timeptr parameter.
This function uses the local time-zone information.
The format parameter consists of a series of zero or more conversion specifiers and ordinary
characters. Each conversion specification starts with a % (percent sign) and ends with a conver-
sion code character that specifies the conversion format. The function replaces the conversion
specification with the appropriately formatted date or time value. Ordinary characters are written
to the output buffer unchanged.
527192-018 Hewlett-Packard Company 6−97