Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

date(1) OSS Shell and Utilities Reference Manual
OW Species the week number of the year (with Monday as the rst day of the week) using
the locales alternative numeric symbols.
Oy Species the year (offset from the display of the %C eld descriptor) in alternative
representation.
p Displays the locales 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 eld 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 specied by the LC_TIME environment variable, if dened.
U Displays the week number of the year (Sunday is the rst 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 rst day of the week) as a
decimal number (00 through 53).
x Displays the locales appropriate date representation.
X Displays the locales 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 specied 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.
34 Hewlett-Packard Company 527188-003