DATE(1) SysV DATE(1)
NAME
date - print and set the date
SYNOPSIS
date [ mmddhhmm[yy] ] [ -f | -a ] [ +format ]
DESCRIPTION
If no argument is given, or if the argument begins with +, the current
date and time are printed. Otherwise, the current date is set. The
first mm is the month number; dd is the day number in the month; hh is
the hour number (24 hour system); the second mm is the minute number; yy
is the last 2 digits of the year number and is optional. For example:
date
10080045
sets the date to Oct 8, 12:45 AM. The current year is the default if no
year is mentioned. The system operates in GMT. date takes care of the
conversion to and from local standard and daylight time. Only the
superuser can change the date.
If an argument begins with +, the output of date is under the control of
the user. All output fields are of fixed size (zero padded if
necessary). Each field descriptor is preceded by % and is replaced in
the output by its corresponding value. A single % is encoded by %%. All
other characters are copied to the output without change. The string is
always terminated with a new-line character.
OPTIONS
-f Forces the time to be set backward.
NOTE 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 backward, 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 result in the loss of data.
-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 backward does not
eliminate the risk of generating duplicate UIDs. After
using date -a to set the system time backward, the
system must not be rebooted until the previous system
time has been passed.
Field Descriptors:
n Insert a new-line character
t Insert a tab character
m Month of year - 01 to 12
d Day of month - 01 to 31
y Last 2 digits of year - 00 to 99
D Date as mm/dd/yy
H Hour - 00 to 23
M Minute - 00 to 59
S Second - 00 to 59
T Time as HH:MM:SS
j Day of year - 001 to 366
w Day of week - Sunday = 0
a Abbreviated weekday - Sun to Sat
h Abbreviated month - Jan to Dec
r Time in AM/PM Notation
EXAMPLE
The following input:
date '+DATE: %m/%d/%y%nTIME: %H:%M:%S'
would have generated as output:
DATE: 08/01/76
TIME: 14:45:05
FILES
/usr/lib/cftime/*
DIAGNOSTICS
no permission
You are not the super-user and you try to change the date.
bad conversion
The date set is syntactically incorrect.
bad format character
The field descriptor is not recognizable.
NOTES
To set the date format, or change the existing format, see ctime(3C),
cftime(4), and environ(5).
WARNING
Using date to set current date and time backward can cause the creation
of objects possessing previously assigned UIDs.
SEE ALSO
ctime(3C), cftime(4), environ(5).