Manual page for date(1)
date - write the date and time
/usr/bin/date [-u] [+format]
/usr/bin/date [-a [-]sss.fff]
/usr/bin/date [-u] [[mmdd]HHMM
/usr/xpg4/bin/date [-u] [+format]
/usr/xpg4/bin/date [-a [-]sss.fff]
/usr/xpg4/bin/date [-u] [[mmdd]HHMM
utility writes the date and time to standard output
or attempts to set the system date and time.
By default, the current date and time will be written.
Specifications of native language translations of
month and weekday names are supported.
The month and weekday names used for a language are based
on the locale specified by the environment variable
The following is the default form for the "C" locale:
%a %b %e %T %Z %Y
Fri Dec 23 10:10:42 EST 1988
The following options are supported:
- -a [-]sss.fff
Slowly adjust the time by
represents fractions of a second).
This adjustment can be positive or negative.
The system's clock will be sped up or slowed down until it has drifted
by the number of seconds specified.
Display (or set) the date in Greenwich Mean Time
bypassing the normal conversion to
(or from) local time.
The following operands are supported:
If the argument begins with
the output of
is the result of passing
and the current time to
uses the conversion specifications listed on the
manual page, with the conversion specification for
determined by whether
Locale's date and time representation.
This is the default output for
Century (a year divided by 100 and truncated to an integer) as a
decimal number [00-99].
The string is always terminated with a
An argument containing blanks must be quoted; see the
Day number in the month
Hour number (24 hour system)
Century minus one
Last 2 digits of the year number
The month, day, year, and century may be omitted;
the current values are applied as defaults.
sets the date to Oct 8, 12:45 a.m.
The current year is the default because no year is supplied.
The system operates in GMT.
takes care of the conversion to and from
local standard and daylight time.
Only the super-user may change the date.
After successfully setting the date and time,
displays the new date according
to the default format.
to determine the correct time zone information;
example% date '+DATE: %m/%d/%y%nTIME: %H:%M:%S'
generates as output:
for descriptions of the following environment variables that affect
the execution of
Determine the timezone in which the time and date are written,
option is specified. If the
variable is not set and the
is not specified, the system default timezone is used.
The following exit values are returned:
An error occurred.
- no permission
You are not the super-user and you tried to change the date.
- bad conversion
The date set is syntactically incorrect.
If you attempt to set the current date to one of the dates that the standard and alternate time zones change
(for example, the date that daylight time is starting or ending),
and you attempt to set the time to a time in the interval
between the end of standard time and the beginning of the alternate time
(or the end of the alternate time and the beginning of standard time),
the results are unpredictable.
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97