4.4BSD/usr/share/man/cat1/date.0
DATE(1) BSD Reference Manual DATE(1)
NNAAMMEE
ddaattee - display or set date and time
SSYYNNOOPPSSIISS
ddaattee [--dd _d_s_t] [--rr _s_e_c_o_n_d_s] [--tt _m_i_n_u_t_e_s___w_e_s_t] [--nnuu] [++_f_o_r_m_a_t]
[[yy[mm[dd[hh]]]]mm[.ss]]
DDEESSCCRRIIPPTTIIOONN
DDaattee displays the current date and time when invoked without arguments.
Providing arguments will format the date and time in a user-defined way
or set the date. Only the superuser may set the date.
The options are as follows:
--dd Set the kernel's value for daylight savings time. If _d_s_t is non-
zero, future calls to gettimeofday(2) will return a non-zero
`tz_dsttime'.
--nn The utility timed(8) is used to synchronize the clocks on groups
of machines. By default, if timed is running, ddaattee will set the
time on all of the machines in the local group. The --nn option
stops ddaattee from setting the time for other than the current ma-
chine.
--rr Print out the date and time in _s_e_c_o_n_d_s from the Epoch.
--tt Set the kernel's value for minutes west of GMT. _M_i_n_u_t_e_s___w_e_s_t
specifies the number of minutes returned in `tz_minuteswest' by
future calls to gettimeofday(2).
--uu Display or set the date in UCT (universal) time.
An operand with a leading plus (``+'') sign signals a user-defined format
string which specifies the format in which to display the date and time.
The format string may contain any of the conversion specifications de-
scribed in the strftime(3) manual page, as well as any arbitrary text.
The format string for the default display is:
``%a %b %e %H:%M:%S %Z n''.
If an operand does not have a leading plus sign, it is interpreted as a
value for setting the system's notion of the current date and time. The
canonical representation for setting the date and time is:
_y_y Year in abbreviated form (.e.g 89 for 1989).
_m_m Numeric month. A number from 1 to 12.
_d_d Day, a number from 1 to 31.
_h_h Hour, a number from 0 to 23.
_m_m Minutes, a number from 0 to 59.
_._s_s Seconds, a number from 0 to 61 (59 plus a a maximum of two
leap seconds).
Everything but the minutes is optional.
Time changes for Daylight Saving and Standard time and leap seconds and
years are handled automatically.
EEXXAAMMPPLLEESS
The command:
date ``+DATE: %m/%d/%y%nTIME: %H:%M:0n''
will display:
DATE: 11/21/87
TIME: 13:36:16
The command:
date 8506131627
sets the date to ``June 13, 1985, 4:27 PM''.
The command:
date 1432
sets the time to 2:32 PM, without modifying the date.
FFIILLEESS
/var/log/wtmp A record of date resets and time changes.
/var/log/messages A record of the user setting the time.
SSEEEE AALLSSOO
gettimeofday(2), strftime(3), utmp(5), timed(8)
R. Gusella, and S. Zatti, _T_S_P_: _T_h_e _T_i_m_e _S_y_n_c_h_r_o_n_i_z_a_t_i_o_n _P_r_o_t_o_c_o_l _f_o_r _U_N_I_X
_4_._3_B_S_D.
DDIIAAGGNNOOSSTTIICCSS
Exit status is 0 on success, 1 if unable to set the date, and 2 if able
to set the local date, but unable to set it 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, ddaattee prints: `Network time being set'. The message `Communication
error with timed' occurs when the communication between ddaattee and timed
fails.
BBUUGGSS
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-savings time. Thus, if you use both UNIX and VMS, VMS
will be running on GMT.
SSTTAANNDDAARRDDSS
The ddaattee command is expected to be compatible with IEEE Std1003.2
(``POSIX'').
4.4BSD June 1, 1993 2