SYNOPSIS
date [-u] [+format]
date [-u] [-b] HHMM | mmddHHMM[[cc]yy]
date -a [-]sss.fff
DESCRIPTION
Date displays the current date if invoked without arguments or with a
+format argument.
If the first argument does not start with +, date sets the system time
to the given value, which may consist of
lfB l. mm month of year (01-12) dd day of month (01-31)
HH hour (00-23) MM minute (00-59) cc first two digits of
year yy second two digits of year
The following options alter the behavior of date:
-a [-]sss.fff
Adjust the system clock by sss seconds and fff milliseconds,
speeding up or, with -, slowing down.
-u Use UTC values for printing and setting the date.
The following option is an extension:
-b Causes date not to alter the `wtmp' file for the system time
change.
An argument starting with + specifies a format string to print the cur-
rent date. A percent character % introduces a field descriptor with
one or two following characters which is replaced by a part of the cur-
rent date, as shown in the table below. Other characters are printed
literally. A newline character is printed at the end of the output.
Field descriptors:
l3 l. a T{ locale-specific abbreviated weekday name (Sys-
tem III) T} A locale-specific full weekday name (SVID3,
POSIX.2) b T{ locale-specific abbreviated month name (SVID3,
POSIX.2) T} B T{ locale-specific full month name (SVID3,
POSIX.2) T} c T{ locale-specific date and time (SVID3,
POSIX.2) T} C T{ century - 19 or 20 (POSIX.2)
(/usr/5bin/s42/date, /usr/5bin/posix/date,
/usr/5bin/posix2001/date)
default output format (/usr/5bin/date) T} d T{ day of month -
01 to 31 (System III) T} D T{ date as mm/dd/yy (System III)
T} e T{ day of month - 1 to 31 (SVID3, POSIX.2) T} F T{
date as yyyy-mm-dd T} g T{ week-based year within century -
00 to 99 T} G T{ week-based year including century - 0000 to
9999 T} h T{ same as %b (System III) T} H T{ hour - 00 to
(SVID3, POSIX.2) T} x T{ locale-specific date (POSIX.2) T}
X T{ locale-specific time (SVID3, POSIX.2) T} y T{ last
two digits of year - 00 to 99 (System III) T} Y T{ four-digit
year - 1970 to 2037 (SVID3, POSIX.2) T} z T{ numeric timezone
T} Z T{ timezone name (SVID3, POSIX.2) T} % T{ percent
sign (System III) T} Ec T{ alternative date and time (POSIX.2)
T} EC T{ alternative base year (period) (POSIX.2) T} Ex T{
alternative date (POSIX.2) T} EX T{ alternative time (SUSv2)
T} Ey T{ offset from %EC in years (POSIX.2) T} EY T{ full
alternative year (POSIX.2) T} Od T{ day of month filled with
leading zero using alternative numerals (POSIX.2) T} Oe T{ day
of month filled with leading space using alternative numerals
(POSIX.2) T} OH T{ 24-hour clok using alternative numerals
(POSIX.2) T} OI T{ 12-hour clock using alternative numerals
(POSIX.2) T} Om T{ month of year using alternative numerals
(POSIX.2) T} OM T{ minute using alternative numerals (POSIX.2)
T} OS T{ second using alternative numerals (POSIX.2) T}
Ou T{ weekday (Monday = 1) using alternative numerals
(POSIX.2) T} OU T{ week of year (cf. %U) using alternative
numerals (POSIX.2) T} OV T{ week of year (cf. %V) using alter-
native numerals (POSIX.2) T} Ow T{ weekday (Sunday = 0) using
alternative numerals (POSIX.2) T} OW T{ week of year (cf. %W)
using alternative numerals (POSIX.2) T} Oy T{ year (offset
from %C) using alternative numerals (POSIX.2) T}
Compatibility references:
l l. System III AT&T System III manual page date(1).
SVID3 T{ AT&T System V Interface Definition, Third Edition,
Volume II, 1992, date(BU_CMD). Includes all field descriptors
present in System III. T} POSIX.2 T{ ISO/IEC 9945-2:1993(E),
4.15.4.1-4.15.4.2, pp. 241-242. Includes all field descriptors
present in System III. T} SUSv2 T{ The Open Group, Single
UNIX Specification, Version 2, (C) 1997, date(XCU). Includes
all field descriptors present in POSIX.2. T}
When no arguments are given, the format defaults to
%a %b %e %H:%M:%S %Z %Y
in the C or POSIX locale, resulting in an output like
Wed Feb 26 17:48:54 CET 2003
ENVIRONMENT VARIABLES
LANG, LC_ALL
See locale(7).
LC_TIME
Alters the strings printed when format arguments are given.
Man(1) output converted with
man2html