Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)
Guardian Native C Library Calls (t - z) wcsftime(3)
NAME
wcsftime - Converts a date and time to a wide-character string
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <wchar.h>
size_t wcsftime(
wchar_t *wcs,
size_t maxsize,
const char *format,
const struct tm *timptr);
PARAMETERS
wcs Points to the wide-character array that contains the output date and time string.
maxsize Specifies the maximum number of bytes or wide characters 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 wcsftime() function formats the data in the timptr parameter according to the specification
contained in the format parameter and places the resulting wide-character string into the wcs
parameter. No more than the number of wide characters specified by the maxsize parameter are
written to the array, including the terminating null wide character.
The wcsftime() function behaves the same as the strftime( ) function, except that the ouput
buffer is wchar_t. Indeed, wcsftime() eventually calls strftime( ) which performs the conver-
sion in single byte first. Then the output from strftime() is converted to wide character string by
mbstowcs(), up to the limit of wide-character codes specified by the maxsize parameter. Only
the wchar.h header file needs to be specified for the wcsftime() function.
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.
The format parameter has the following syntax:
[ordinary-text][%[[-|0]width][.precision] format-code [ordinary-text]]...
ordinary-text Text that is copied to the output parameter with no changes.
527192-005 Hewlett-Packard Company 7−57