DATE(1) COMMAND REFERENCE DATE(1)
NAME
date - print and set the date
SYNOPSIS
date [ -u ] [ -z zone ] [ -d daylight_type ] [
[yy]mmddhhmm[.ss] ]
[ +format ]
DESCRIPTION
The current date, time, and time zone are printed or set.
Only the superuser can set the time. 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 specified. The system operates in
GMT. date takes care of the conversion to and from local
standard and daylight time.
If the environment variable TZNAME is set, its value is used
for the time zone when it is printed. If TZNAME contains a
comma, the text before the comma is used for standard time
and the text after the comma is used for daylight time. For
example, if TZNAME is set to ``Pacific Standard Time,Pacific
Daylight Time'', the date ``June 11, 1984 at 4:30 pm'' would
be printed as ``Mon Jun 11 16:30:00 Pacific Daylight Time
1984''.
The time zone can be set with the -z option. The zone can
be either the number of hours west of GMT or the time zone
name. The time zone name can be uppercase, lowercase, or
mixed. The following table shows the standard values for
zone. The default allows for daylight time if daylight time
is being observed.
Zone Standard Values
Eastern European -2 EET EET DST
Middle European -1 MET MET DST
Western European 0 WET WET DST
Atlantic 4 AST ADT
Eastern 5 EST EDT
Central 6 CST CDT
Printed 4/7/89 1
DATE(1) COMMAND REFERENCE DATE(1)
Mountain 7 MST MDT
Pacific 8 PST PDT
Aust: Eastern -10 AEST AEST
Aust: Central -10.5 ACST ACST
Aust: Western -8 AWST AWST
Other values for hours (and, optionally, minutes) west of
GMT ranging from -12[:00] to +12[:00] can also be specified.
If hours and minutes are both used, they must be separated
by a colon (:). If no operator is given, + is assumed.
Leading zeros are optional. No fractions are allowed.
The -d option sets the standard types of daylight savings
time. The daylight_types are given below.
Daylight Protocols Value
no daylight time in effect
none
Eastern European EET
Middle European MET
Western European WET
United States USA
Canada CAN
Australian AUST
If there is an argument after the option that 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(3s). 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 terminated with a new-line character, unless
the final character in the format is a lone %.
Field Descriptors:
n insert a new-line character
t insert a tab character
Printed 4/7/89 2
DATE(1) COMMAND REFERENCE DATE(1)
D date as mm/dd/yy
m month of year - 01 to 12
d day of month - 01 to 31
y last 2 digits of year - 00 to 99
h abbreviated month - Jan to Dec
a abbreviated weekday - Sun to Sat
w day of week - Sunday = 0
j Julian date - 001 to 366
T time as HH:MM:SS
H hour - 00 to 23
M minute - 00 to 59
S second - 00 to 59
r time in AM/PM notation
Z time zone
OPTIONS
-u Universal time. The time printed is
Greenwich Mean Time (GMT).
-z zone Use the given zone.
-d daylight_type Use the given daylight notation.
EXAMPLES
The following example sets the Eastern time zone with no
daylight savings time:
date -z est -d none
The following example sets the time zone for 2 hours, 13
minutes west of Greenwich:
date -z 02:13
The following example:
date '+DATE: %m/%d/%y%nTIME: %H:%M:%S'
Printed 4/7/89 3
DATE(1) COMMAND REFERENCE DATE(1)
generates the output:
DATE: 08/01/76
TIME: 14:45:05
FILES
/etc/rc.date Resets the desired time zone when the
workstation is rebooted
VARIABLES
TZNAME Time zone name. Either a single name or a
comma-separated pair.
RETURN VALUE
[NO_ERRS] Command completed without error.
[USAGE] Incorrect command line syntax. Execution
terminated.
[NP_ERR] An error occurred that was not a system
error. Execution terminated.
[P_WARN] A system error occurred. Execution continues.
See intro(2) for more information on system
errors.
SEE ALSO
cal(1), gettimeofday(2), and ctime(3c).
Printed 4/7/89 4
%%index%%
na:240,81;
sy:321,362;
de:683,2114;3109,2227;5648,651;
op:6299,381;
ex:6680,411;7403,79;
fi:7482,177;
va:7659,205;
rv:7864,553;
se:8417,196;
%%index%%000000000174