DATE(1) BSD DATE(1)
NAME
date - print and set the date
SYNOPSIS
date [ -u ] [ -n | -N ] [ -f | -a ] [ 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 Set the time only on the local node. This is the default
option when using date to change the system time.
-N If timed is running to synchronize the clocks of machines in a
local area network, set the time globally on all machines.
-f Forces the time to be set backward.
NOTE At boot-time, 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 machine must not be rebooted
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 result in data loss.
-a If the target time has been set forward, the -a option will
increment the system time at a faster rate until the target
time (plus the elapsed real time) has been reached. If the
target time has been set backward, the -a option will retard
advancement of the system time, gradually decreasing the
difference between the two times, until the target time (plus
the elapsed real time) is met.
NOTE Using date -a to set the time backwards does not
eliminate the risk of generating duplicate UIDs. After
using date -a to set the system time backwards, the
system must not be rebooted until the previous system
time has been passed.
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.
SEE ALSO
adjtime(2), gettimeofday(2), utmp(5)