HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

s
strftime(3C) strftime(3C)
%x Locale’s appropriate date representation.
%X Locale’s appropriate time representation.
%y Year without century as a decimal number [00,99].
%Y Year with century as a decimal number.
%Z Time zone name (or by no characters if no time zone exists).
%% The percent (%) character.
The following directives are provided for backward compatibility with the directives supported by date(1)
and the ctime(3C) functions. These directives may be removed in a future release. It is recommended that
the directives above be used in preference to those below.
%E Locale’s combined Emperor/Era name and year (use
%EC%Ey instead).
%F Locale’s full month name (use
%B instead).
%N Locale’s Emperor/Era name (use
%EC instead).
%o Locale’s Emperor/Era year (use
%Ey instead).
%z Time zone name (or by no characters if no time zone exists) (use
%Z instead).
If a directive is not one of the above, the behavior is undefined.
Modified Conversion Specifiers
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. Alternative numeric symbols refers to those sym-
bols defined by the
ALT_DIGIT (see langinfo(5)) in the locale.
%Ec The locales alternative appropriate date and time representation.
%EC The name of the base year (period/Emperor/Era) in the locales alternative representation.
%Ex The locale’s alternative date representation
%EX The locale’s alternative time representation.
%Ey The offset from %EC (year only) in the locale’s alternative representation.
%EY The full alternative year representation.
%Od 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 the day of the month, using the locale’s alternative numeric symbols, filled as needed with
leading spaces.
%OH The hour (24-hour clock) using the locale’s alternative numeric symbols.
%OI The hour (12-hour clock) using the locale’s alternative numeric symbols.
%Om The month using the locale’s alternative numeric symbols.
%OM The minutes using the locale’s alternative numeric symbols.
%OS The seconds using the locale’s alternative numeric symbols.
%Ou The weekday as a number in the locale’s alternative representation (Monday=1).
%OU The week number of the year (Sunday as the first day of the week, rules corresponding to
%U) using the locale’s alternative numeric symbols.
%OV The week number of the year (Monday as the rst day of the week, rules corresponding to
%V) using that locale’s alternative numeric symbols.
%Ow The number of the weekday (Sunday=0) using the locale’s alternative numeric symbols.
%OW The week number of the year (Monday as the first day of the week) using the locale’s alter-
native numeric symbols.
%Oy The year (offset from %C) in the locales alternative representation and using the locales
alternative symbols.
Field Width and Precision
An optional field width and precision specification can immediately follow the initial % of a directive in the
following order:
[-0]w The decimal digit string w specifies a minimum field width in which the result of the
conversion is right- or left-justified. It is right-justified (with space padding) by default. If
the optional flag - is specified, it is left-justified with space padding on the right. If the
optional flag 0 is specified, it is right-justified and padded with zeros on the left.
.p The decimal digit string p specifies the minimum number of digits to appear for the d, H, I,
j, m, M, o, S, U, w, W, y and Y directives, and the maximum number of bytes to be used
from the a, A, b, B, c, D, E, F, h, n, N, p, r, t, T, x, X, z, Z, and % directives. In the first
case, if a directive supplies fewer digits than specified by the precision, it will be expanded
HP-UX 11i Version 2: December 2007 Update 2 Hewlett-Packard Company 455