BSD 4_3_Reno development
[unix-history] / usr / share / man / cat1 / date.0
DATE(1) UNIX Reference Manual DATE(1)
N\bNA\bAM\bME\bE
d\bda\bat\bte\be - Display or set date and time
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
d\bda\bat\bte\be [-\b-n\bnu\bu] [-\b-d\bd _\bd_\bs_\bt] [-\b-t\bt _\bm_\bi_\bn_\bu_\bt_\be_\bs__\bw_\be_\bs_\bt] [yymmddhhmm [.ss]]
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
D\bDa\bat\bte\be displays today's date and time when invoked without arguments. Pro-
viding an argument will set the desired date; only the superuser can set
the date.
Options are:
-\b-d\bd Set the kernel's values for daylight savings time. If _\bd_\bs_\bt is non-
zero, future calls to gettimeofday(2) will return a non-zero
`tz_dsttime'.
-\b-t\bt Set the kernel's values for minutes west of GMT. _\bM_\bi_\bn_\bu_\bt_\be_\bs__\bw_\be_\bs_\bt pro-
vides the number of minutes returned by future calls to gettimeof-
day(2) in `tz_minuteswest'.
-\b-u\bu Display or set the date in GMT (universal) time.
The canonical representation for setting the date and time:
_\by_\by Year in abbreviated form (.e.g 89 for 1989).
_\bm_\bm Numeric month. A number from 01 to 12.
_\bd_\bd Day, a number from 01 to 31.
_\bh_\bh Hour, a number from 00 to 24.
_\bm_\bm Minutes, a number from 00 to 60.
._\bs_\bs Seconds, a number from 00 to 60.
The command:
date 8506131627
sets the date to June 13 1985, 4:27 PM.
To reset today's time, the incantation can be shortened to just the hours
and minutes:
date 1432
sets the time to 2:32 PM, unaffecting the date.
Providing a system stays running, date will handle time changes for
daylight/standards savings time and leap times.
If timed(8) is running to synchronize the clocks of machines in a local
area network, d\bda\bat\bte\be sets the time globally on all those machines unless
the -\b-n\bn option is given.
F\bFI\bIL\bLE\bES\bS
/_\bv_\ba_\br/_\bl_\bo_\bg/_\bw_\bt_\bm_\bp A record of date resets and time changes.
/_\bv_\ba_\br/_\bl_\bo_\bg/_\bm_\be_\bs_\bs_\ba_\bg_\be_\bs A record of the name of the user setting the time.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
gettimeofday(2), utmp(5), timed(8)
_\bT_\bS_\bP: _\bT_\bh_\be _\bT_\bi_\bm_\be _\bS_\by_\bn_\bc_\bh_\br_\bo_\bn_\bi_\bz_\ba_\bt_\bi_\bo_\bn _\bP_\br_\bo_\bt_\bo_\bc_\bo_\bl _\bf_\bo_\br _\bU_\bN_\bI_\bX _\b4._\b3_\bB_\bS_\bD, R. Gusella
and S. Zatti
H\bHI\bIS\bST\bTO\bOR\bRY\bY
D\bDa\bat\bte\be appeared in Version 6 AT&T UNIX.
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
Exit status is 0 on success, 1 on complete failure to set the date, and 2
on successfully setting the local date but failing globally.
Occasionally, when timed synchronizes the time on many hosts, the setting
of a new time value may require more than a few seconds. On these occa-
sions, d\bda\bat\bte\be prints: `Network time being set'. The message `Communication
error with timed' occurs when the communication between d\bda\bat\bte\be and timed
fails.
B\bBU\bUG\bGS\bS
The system attempts to keep the date in a format closely compatible with
VMS. VMS, however, uses local time (rather than GMT) and does not under-
stand daylight-saving time. Thus, if you use both UNIX and VMS, VMS will
be running on GMT.