date(1)
NAME
date − print date and time
SYNTAX
date [[yy[mm[dd]]]hhmm[.ss][-[-]tttt][z]] [ +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 clock); the second mm is the minute number; .ss the second; -[-]tttt is the minutes west of Greenwich; a positive number means your time zone is west of Greenwich (for example, North and South America) and a negative number means it is east of Greenwich (for example Europe); z is a one letter code indicating the dst correction mode (n=none, u=usa, a=australian, w=western europe, m=middle europe, e=eastern europe); yy is the last 2 digits of the year number and is optional. The following example sets the date to Oct 8, 12:45 AM:
date 10080045
The current year is the default if no year is mentioned. The system operates in GMT. The date takes care of the conversion to and from local standard and daylight time.
If the argument begins with +, the output of date is under the control of the user. The format for the output is similar to that of the first argument to printf(.). 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
The following is a list of 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
u Displays time in Greenwich Mean Time
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 command line
date ′+DATE: %m/%d/%y%nTIME: %H:%M:%S′
generates the following output
DATE: 08/01/76
TIME: 14:45:05
DIAGNOSTICS
No permission If you aren’t the super-user and you try to change the date
bad conversion If the date set is syntactically incorrect
bad format character
If the field descriptor is not recognizable
CAUTION
Do not change the date while the system is running in multiuser mode.
FILES
/dev/kmem
Commands