Convert the internal time and date specification into a character string
and place the results in the area pointed to by ucs under the direction
of format. The null-terminated result of, at most, maxsize code
elements, is placed in the memory location addressed by ucs. The
format string may contain conversion specification characters and
characters that are placed unchanged into the array. The characters that
are converted are determined by the LC_TIME category of the locale indicated
by the locale_object handle argument locale_object and by
the values in the time structure pointed to by timeptr. The results
are unpredictable when objects being copied overlap.
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 timeptr parameter
into readable form in the output string.
A % (percent sign) introduces a conversion specification.
The type of conversion is specified by one or two conversion characters.
The characters and their meanings are:
- a
Represents the locale's abbreviated weekday
name (for example, Sun).
%A
Represents
the locale's full weekday name (for example, Sunday).
%b
Represents
the locale's abbreviated month name (for example, Jan).
%B
Represents
the locale's full month name (for example, January).
%c
Represents
the locale's date and time format.
%C
Represents
the century as a decimal number (00-99).
%d
Represents
the day of the month as a decimal number (01 to 31).
%D
Represents
the date in %m/%d/%y format (for example, 01/31/94).
%e
Represents
the day of the month as a decimal number ( 1 to 31). A single digit is preceded
by a space character.
%h
%H
Represents the
24-hour-clock hour as a decimal number (00 to 23).
%I
Represents
the 12-hour-clock hour as a decimal number (01 to 12).
%j
Represents
the day of the year as a decimal number (001 to 366).
%m
Represents
the month of the year as a decimal number (01 to 12).
%M
Represents
the minute of the hour as a decimal number (00 to 59).
%n
Specifies
a new-line character.
%p
Represents
the locale's AM or PM string.
%r
Represents
the time with AM/PM notation (%I:%M:%S%p).
%R
Represents
24-hour-clock time in the format %H:%M.
%S
Represents
the second of the minute as a decimal number (00 to 61).
%t
Specifies
a tab character.
%T
Represents
the time in the format %H:%M:%S.
%u
Represents
the day of the week as a decimal number (1 to 7). 1 represents Monday.
%U
Represents
the week of the year as a decimal number (00 to 53). Sunday is considered
the first day of the week.
%V
Represents
the week of the year as a decimal number (01 to 53). Monday is considered
the first day of the week. If the week containing 1 January has four or
more days in the new year, then it is considered week 1; otherwise, it is
week 53 of the previous year, and the next week is week 1.
%w
Represents
the day of the week as a decimal number (0 to 6). 0 represents Sunday.
%W
Represents
the week of the year as a decimal number (00 to 53). Monday is considered
the first day of the week. All days in a new year preceding the first Sunday
are considered to be week 0.
%x
Represents
the locale's date format.
%X
Represents
the locale's time format.
%y
Represents
the year of the century (00 to 99).
%Y
Represents
the year with century as a decimal number for example (1994).
%Z
Represents the time-zone name or abbreviation if
one can be determined (for example EST). Replaced by no bytes if time zone
information does not exist.
%%
Specifies
a % (percent) sign.
Some conversion specifiers can be modified by the E or O modifier characters
to indicate that an alternative format or specification should be used rather
than the one normally used by the unmodified conversion specifier. If the
alternative format or specification does not exist for the current locale,
the behavior will be as if the unmodified conversion specification were
used.
- Ec
Locale's alternative appropriate date and
time representation.
%EC
is
the name of the base year (period) in the locale's alternative representation.
%Ex
is the locale's alternative
date representation.
%EX
is
the locale's alternative time representation.
%Ey
is the offset from %EC (year only) in the locale's
alternative representation.
%EY
is
the full alternative year representation.
%Od
is
the day of the month using the locale's alternative
numeric symbols; filled as needed with leading zeros if there is any alternative
symbol for zero, otherwise with leading spaces.
%Oe
is replaced by the day of the month, using the
locale's alternative numeric symbols, filled as needed with leading spaces.
%OH
is the hour (24-hour
clock) using the locale's alternative numeric symbols.
%OI
is the hour (12-hour clock) using the locale's
alternative numeric symbols.
%Om
is
the month using the locale's alternative numeric symbols.
%OM
is the minutes using the locale's alternative numeric
symbols.
%OS
is the seconds
using the locale's alternative numeric symbols.
%Ou
is the weekday of the year (Monday = 1) using the
locale's alternative numeric symbols.
%OU
is
the week number of the year (Sunday as the first day of the week) using
the locale's alternative numeric symbols.
%OV
is
replaced by the week number of the year (Sunday as the first day of the
week) using the locale's alternative numeric symbols.
%Ow
is the number of the weekday (Sunday=0) using the
locale's alternative numeric symbols.
%OW
is
the week number of the year (Monday as the first day of the week) using
the locale's alternative numeric symbols.
%Oy
is
the year (offset from %C) in the locale's alternative representation and
using the locale's alternative numeric symbols.
[Back: UniStrftime - Parameters]
[Next: UniStrftime - Related Functions]