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 system); 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. 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. 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 Rfield descriptor is preceded by % and will be 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
Field Descriptors:
nInsert a new-line character
tInsert a tab character
mMonth of year − 01 to 12
dDay of month − 01 to 31
yLast 2 digits of year − 00 to 99
DDate as mm/dd/yy
HHour − 00 to 23
MMinute − 00 to 59
SSecond − 00 to 59
TTime as HH:MM:SS
jDay of year − 001 to 366
wDay of week − Sunday = 0
aAbbreviated weekday − Sun to Sat
hAbbreviated month − Jan to Dec
rTime in AM/PM notation
EXAMPLE
date ′+DATE: %m/%d/%y%nTIME: %H:%M:%S′
would have generated as 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
You should not change the date while the system is running in multiuser mode.
FILES
/dev/kmem