DATE (1)

NAME

date - print or set the date

CONTENTS

Synopsis
Description
Environment Variables
See Also
Notes

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

mmmonth of year (01-12)
ddday of month (01-31)
HHhour (00-23)
MMminute (00-59)
ccfirst two digits of year
yysecond 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 current date. A percent character % introduces a field descriptor with one or two following characters which is replaced by a part of the current 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:
 

alocale-specific abbreviated weekday name (System III)
Alocale-specific full weekday name (SVID3, POSIX.2)
blocale-specific abbreviated month name (SVID3, POSIX.2)
Blocale-specific full month name (SVID3, POSIX.2)
clocale-specific date and time (SVID3, POSIX.2)
Ccentury - 19 or 20 (POSIX.2) (/usr/5bin/s42/date, /usr/5bin/posix/date, /usr/5bin/posix2001/date)
default output format (/usr/5bin/date)
dday of month - 01 to 31 (System III)
Ddate as mm/dd/yy (System III)
eday of month - 1 to 31 (SVID3, POSIX.2)
Fdate as yyyy-mm-dd
gweek-based year within century - 00 to 99
Gweek-based year including century - 0000 to 9999
hsame as %b (System III)
Hhour - 00 to 23 (System III)
Ihour - 01 to 12 (SVID3, POSIX.2)
jday of year - 001 to 366 (System III)
mmonth of year - 01 to 12 (System III)
Mminute - 00 to 59 (System III)
nnewline character (System III)
Ndefault output format
plocale-specific AM/PM string (SVID3, POSIX.2)
rlocale-specific time using AM/PM notation (System III)
Rsame as %H:%M (SVID3)
Ssecond - 00 to 61 (System III)
ttab character (System III)
Ttime as HH:MM:SS (System III)
uweekday - 1 (Monday) to 7 (POSIX.2)
Uweek of year (Sunday as first day of week) - 00 to 53 (SVID3, POSIX.2)
Vweek of year (Monday as first day of week) - 01 to 53 (POSIX.2)
wweekday - 0 (Sunday) to 6 (System III)
Wweek of year (Monday as first day of week) - 00 to 53 (SVID3, POSIX.2)
xlocale-specific date (POSIX.2)
Xlocale-specific time (SVID3, POSIX.2)
ylast two digits of year - 00 to 99 (System III)
Yfour-digit year - 1970 to 2037 (SVID3, POSIX.2)
znumeric timezone
Ztimezone name (SVID3, POSIX.2)
%percent sign (System III)
Ecalternative date and time (POSIX.2)
ECalternative base year (period) (POSIX.2)
Exalternative date (POSIX.2)
EXalternative time (SUSv2)
Eyoffset from %EC in years (POSIX.2)
EYfull alternative year (POSIX.2)
Odday of month filled with leading zero using alternative numerals (POSIX.2)
Oeday of month filled with leading space using alternative numerals (POSIX.2)
OH24-hour clok using alternative numerals (POSIX.2)
OI12-hour clock using alternative numerals (POSIX.2)
Ommonth of year using alternative numerals (POSIX.2)
OMminute using alternative numerals (POSIX.2)
OSsecond using alternative numerals (POSIX.2)
Ouweekday (Monday = 1) using alternative numerals (POSIX.2)
OUweek of year (cf. %U) using alternative numerals (POSIX.2)
OVweek of year (cf. %V) using alternative numerals (POSIX.2)
Owweekday (Sunday = 0) using alternative numerals (POSIX.2)
OWweek of year (cf. %W) using alternative numerals (POSIX.2)
Oyyear (offset from %C) using alternative numerals (POSIX.2)
Compatibility references:
 

System IIIAT&T System III manual page date(1).     
SVID3AT&T System V Interface Definition, Third Edition, Volume II, 1992, date(BU_CMD). Includes all field descriptors present in System III.
POSIX.2ISO/IEC 9945-2:1993(E), 4.15.4.1-4.15.4.2, pp. 241-242. Includes all field descriptors present in System III.
SUSv2The Open Group, Single UNIX Specification, Version 2, © 1997, date(XCU). Includes all field descriptors present in POSIX.2.
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.
TZ Timezone; if unset, the system default is used.

SEE ALSO

adjtime(2), stime(2), strftime(3), locale(7)

NOTES

After setting the date, the hwclock(8) utility is called to adjust the hardware clock on Linux systems.


Heirloom Toolchest DATE (1) 1/24/05
Generated by a modified version of manServer 1.07 from date.1 using man macros with tbl support.