HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)
w
wcsftime(3C) wcsftime(3C)
NAME
wcsftime() - convert date and time to wide-character string
SYNOPSIS
#include <wchar.h>
size_t wcsftime(
wchar_t *__restrict ws,
size_t maxsize,
const char *__restrict format,
const struct tm *__restrict timeptr
);
Unix Standards Only
size_t wcsftime(
wchar_t *__restrict ws,
size_t maxsize,
const wchar_t *__restrict format,
const struct tm *__restrict timeptr
);
Remarks
This function is compliant with the XPG4 Worldwide Portability Interface wide-character formatting func-
tions. It parallels the 8-bit character formatting function defined in strftime(3C).
DESCRIPTION
wcsftime() converts the contents of a tm structure (see ctime(3C)) to a formatted date and time wide-
character string.
wcsftime() places wide characters into the array pointed to by ws as controlled by the string pointed to
by format. The format string consists of zero or more directives and ordinary characters. A directive con-
sists of a % character, an optional field width and precision specification, and a terminating character that
determines the directive’s behavior. All ordinary characters (including the terminating null character) are
converted into corresponding wide characters and are copied into the array. No more than maxsize wide
characters are placed into the array. Each directive is replaced by the appropriate wide characters as
described in the following list. The appropriate wide characters are determined by the program’s locale, by
the values contained in the structure pointed to by timeptr , and by the
TZ environment variable (see
External Influences below).
The definition for this function and the type
wchar_t are provided in the <wchar.h>
header.
Unix Standards Only
wcsftime() places wide characters into the array pointed to by ws as controlled by the wide-character
string pointed by format. The functionality of
wcsftime() is the same except for data type of format.
Directives
The following directives, shown without the optional field width and precision specification, are replaced by
the corresponding wide characters as indicated:
%a Locale’s abbreviated weekday name.
%A Locale’s full weekday name.
%b Locale’s abbreviated month name.
%B Locale’s full month name.
%c Locale’s appropriate date and time representation.
%C The century number (the year divided by 100 and truncated to an integer) as a decimal
number [00-99].
%d Day of the month as a decimal number [01,31].
%D Equivalent to the directive string %m/%d/%y.
%e Day of the month as a decimal number [1,31]; a single digit is preceded by a space.
%h Equivalent to %b.
%H Hour (24-hour clock) as a decimal number [00,23].
%I Hour (12-hour clock) as a decimal number [01,12].
%j Day of the year as a decimal number [001,366].
%m Month as a decimal number [01,12].
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 645