wcsftime.3c (2010 09)

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
functions. 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
consists 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 charac-
ter) are converted into corresponding wide characters and are copied into the array. No more than max-
size wide characters are placed into the array. Each directive is replaced by the appropriate wide charac-
ters as described in the following list. The appropriate wide characters are determined by the programs
locale, by the values contained in the structure pointed to by timeptr , and by the
TZ environment vari-
able (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: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)