DATE(1) BSD DATE(1)
NAME
date - print and set the date
SYNOPSIS
date [ -n ] [ -u ] [ yymmddhhmm[.ss] ]
DESCRIPTION
If you don't specify an argument, date prints the current date and time.
Providing an argument sets the desired date. Only the super-user can set
the date.
OPTIONS
-u Display or set the date in GMT (universal time).
yymmddhhmm[.ss]
If you're setting the date, yy represents the last two digits
of the year; the first mm is the month number; dd is the day
number; hh is the hour number (24-hour system); the second mm
is the minute number; .ss is optional and represents the
seconds.
For example:
date 8906131627
sets the date to June 13 1989, 4:27 PM. The year, month and
day can be omitted; the default values will be the current
ones. The system operates in GMT. The date command takes care
of the conversion to and from local standard and daylight-
saving time.
-n If timed is running to synchronize the clocks of machines in a
local area network, date sets the time globally on all those
machines, unless you specify the -n option.
DIAGNOSTICS
Exit status is 0 on success; 1 on complete failure to set the date; 2 on
successfully setting the local date but failing globally.
FILES
/usr/adm/wtmp To record time-setting.
/usr/adm/messages To record the name of the user setting the time.
WARNING
Using date to set current date and time backwards can cause the creation
of objects possessing previously assigned UIDs.
At boot-time, the Domain/OS incorporates the current date and time into
the algorithm by which it computes UIDs (unique identifiers). After
using date to set the system time backwards, the user must not reboot the
machine until the previous system time has been passed. Rebooting prior
to this time will incur the risk that the UID algorithm will incorporate
a previously used date and time into new UIDs. As Domain/OS relies on
the uniqueness of UIDs, this can have devastating results.
SEE ALSO
gettimeofday(2), utmp(5)