Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
date(1) OSS Shell and Utilities Reference Manual
OW Specifies the week number of the year (with Monday as the first day of the week) using
the locale’s alternative numeric symbols.
Oy Specifies the year (offset from the display of the %C field descriptor) in alternative
representation.
p Displays the locale’s equivalent of either AM or PM.
r Displays the time (12-hour clock) using AM/PM notation (or the nonhown in this
nonEnglish equivalent) in the format hh:mm:ss AM or hh:mm:ss PM. In the OSS locale,
this is equivalent to the field descriptors %I: %m: %S %p.
S Displays the seconds as a decimal number (00 through 61).
t Inserts a tab character.
T Displays the time in 24-hour clock format (00 through 23)ashh:mm:ss (the default
format) or as specified by the LC_TIME environment variable, if defined.
U Displays the week number of the year (Sunday is the first day of the week) as a decimal
number (00 through 53).
w Displays the day of the week as a decimal number (Sunday = 0).
W Displays the week number of the year (Monday is the first day of the week) as a
decimal number (00 through 53).
x Displays the locale’s appropriate date representation.
X Displays the locale’s appropriate time representation.
y Displays the last two numbers of the year as a decimal number (00 through 99).
Y Displays the full year as a decimal number.
Z Displays the time zone name or no characters if the time zone cannot be determined.
%% Inserts a % character.
EXAMPLES
1. To display the current date and time, enter:
date
The output might look like the following:
Thu Apr 9 13:21:30 EDT 1992
2. To display the date and time in a specified format, enter:
date +"%r %d %h %y (%a)"
This displays the date (assume the year is 1992) as:
01:21:30 PM 09 Apr 92 (Thu)
RELATED INFORMATION
Files: locale(4).
STANDARDS CONFORMANCE
The date and time are set through the Guardian environment.
3−4 Hewlett-Packard Company 527188-007