date(1)

date(1)

%Oy Year (offset from %C) in alternate representation.

Field Width and Precision

An optional ®eld width and precision speci®cation can immediately follow the initial % of a formatting directive in the following order:

[-0]widthThe decimal digit string width speci®es a minimum ®eld width in which the result of the conversion is right- or left-justi®ed. The default is right-justi®ed with space padding on the left. If the string starts with "-", the result is left-justi®ed with space padding on the right. If the string starts with "0", the result is right-justi®ed and padded with zeros on the left.

.prec The decimal digit string prec speci®es the minimum number of digits to appear for the d, H, I, j, m, M, o, S, U, w, W, y, and Y numeric directives. If a directive supplies fewer digits than speci®ed by the precision, it will be expanded with leading zeros.

prec speci®es the maximum number of characters 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 % text directives. If a directive supplies more characters than speci®ed by the precision, excess characters are truncated on the right.

If no ®eld width or precision is speci®ed for a d, H, I, m, M, S, U, W, or y directive, the default is .2; for the

jdirective, the default is .3; for Y, the default is .4; for w, the default is .1.

EXTERNAL INFLUENCES

Environment Variables

LC_CTYPE determines the interpretation of the bytes within the format string as single- and/or multi-byte characters.

LC_NUMERIC determines the characters used to form numbers for those directives that produce numbers in the output. The characters used are those de®ned by alt_digit (see locale(1) and ALT_DIGIT in langinfo(5)).

LC_TIME determines the content (for example, the weekday names produced by the %a directive) and format (for example, the current time representation produced by the %X directive) of date and time strings output by the date command.

LC_MESSAGES determines the language in which messages (other than the date and time strings) are displayed.

If LC_CTYPE, LC_NUMERIC, LC_TIME, or LC_MESSAGES is not speci®ed or is null, it defaults to the value of LANG.

If LANG is not speci®ed or is null, it defaults to C (see lang(5)).

If any internationalization variable contains an invalid setting, all internationalization variables default to

C(see environ(5)).

TZ determines the conversion between the system time in UTC and the time in the user's local time zone. See environ(5) and tztab(4). TZ also determines the content (that is, the time-zone name produced by the %z and %Z directives) of date and time strings output by the date command.

If TZ is not set or is set to the empty string, its default value is EST5EDT.

International Code Set Support

Single- and multi-byte character code sets are supported.

DIAGNOSTICS

The following messages may be displayed.

bad conversion

The date/time speci®cation is syntactically incorrect. Check it against the usage and for the correct range of each of the digit-pairs.

bad format character - c

d

HP-UX Release 11i: December 2000

− 4 −

Section 1167