DATE(1-SysV) RISC/os Reference Manual DATE(1-SysV)
NAME
date - print and set the date
SYNOPSIS
date [ +format ]
date [ mmddhhmm[yy] ]
DESCRIPTION
If no argument is given, or if the argument begins with +
(as in the first format above), the current date and time
are printed.
In the second format above, the current date is set. Only
the superuser may change the date. 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.
If the 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 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.
If the argument contains embedded blanks it must be quoted
(see the EXAMPLE section).
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
Printed 1/15/91 Page 1
DATE(1-SysV) RISC/os Reference Manual DATE(1-SysV)
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 are not the super-user and you
try to change the date;
bad conversion if the date set is syntactically
incorrect;
FILES
/dev/kmem
/etc/TZ
WARNING
Should you need to change the date while the system is run-
ning multi-user, use sysadm(1) datetime.
If dates appear to be off by some whole hour amount, make
sure a valid timezone is present in /etc/TZ. See timezone(4)
and zic(8) for more information.
SEE ALSO
sysadm(1).
timezone(4) in the Programmer's Reference Manual.
zic(8) in the System Administrator's Reference Manual.
Page 2 Printed 1/15/91