UniStrptime converts the character string pointed to by buf to a
time value, which is stored in the structure pointed to by tm, using
the format specified by fmt. A pointer to the character following
the last character in the string pointed to by buf is returned. The
character string pointed to by fmt consists of field descriptors
and text characters, similar to the scanf. Each field descriptor consists
of a % character followed by another character that specifies the replacement
for the field descriptor. The type of conversion is specified by one or
two conversion characters. The characters and their meanings are specified
in the Format Strings and Modified Directives sections.
FORMAT STRINGS
- a
Day of the week, abbreviated or full name
may be specified (for example Sun).
%A
%b
Represents the
locale's month name, abbreviated or fullname may be specified.
%B
%c
Represents the
locale's date and time format.
%C
Represents
the century number (0 to 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/91).
%e
%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
Represents
any white space.
%p
Represents
the locale's AM or PM string.
%r
Represents
the time as %I:%M:%S%p.
%R
Represents
the time as %H:%M.
%S
Represents
the second of the minute as a decimal number (00 to 61).
%t
Represents
any white space.
%T
Represents
time in the format %H:%M:%S.
%U
Represents
the week of the year as a decimal number (00 to 53). Sunday is considered
the first day of the week.
%w
Represents
the day of the week as a decimal number (0 to 6). Sunday is considered as
0.
%W
Represents the week
of the year as a decimal number (00 to 53). Monday is considered the first
day of the week.
%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).
%%
Specifies
a % (percent) sign.
MODIFIED DIRECTIVES
Some directives can be modified by the E and O modifier characters to indicate
that an alternative format or specification should be used rather than the
one normally used by the unmodified directive. If the alternative format
or specification does not exist in the current locale, the behavior will
be as if the unmodified directive were used.
- Ec
is the 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; leading
zeros are permitted but not required.
%Oe
%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 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.
A format specification consisting of white-space characters is performed
by reading input until the first nonwhite-space character (which is not
read) or no more characters can be read.
A format specification consisting of an ordinary character is performed
by reading the next character from the string parameter. If this character
differs from the character comprising the directive, the directive fails
and the differing character and any characters following it remain unread.
Case is ignored when matching string items, such as month or weekday names.
[Back: UniStrptime - Parameters]
[Next: UniStrptime - Related Functions]