ANSIfication
[unix-history] / usr / src / bin / date / date.1
CommitLineData
fd0821e6
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
f92f4bba 5.\" @(#)date.1 6.6 (Berkeley) %G%
fd0821e6 6.\"
842cd991 7.TH DATE 1 ""
fd0821e6
KM
8.UC 4
9.SH NAME
10date \- print and set the date
11.SH SYNOPSIS
12.B date
f92f4bba 13.RB "[-nu] [-d dst] [-t minutes_west] [yymmddhhmm [" . "ss] ]"
fd0821e6 14.SH DESCRIPTION
f92f4bba
KB
15If no arguments are given, the current date and time are
16printed. Providing an argument will set the desired date;
17only the superuser can set the date. The \fI-d\fP and \fI-t\fP
18flags set the kernel's values for daylight savings time and
19minutes west of GMT. If \fIdst\fP is non-zero, future calls
20to \fIgettimeofday\fP(2) will return a non-zero \fItz_dsttime\fP.
21\fIMinutes_west\fP provides the number of minutes returned
86f03794
KB
22by future calls to \fIgettimeofday\fP(2) in \fItz_minuteswest\fP. The
23\fI-u\fP flag is used to display or set the date in GMT (universal) time.
fd0821e6 24.I yy
3ceb636f 25represents the last two digits of the year;
fd0821e6
KM
26the first
27.I mm
28is the month number;
29.I dd
3ceb636f 30is the day number;
fd0821e6
KM
31.I hh
32is the hour number (24 hour system);
33the second
34.I mm
35is the minute number;
36.BI . ss
3ceb636f 37is optional and represents the seconds.
fd0821e6
KM
38For example:
39.IP
3ceb636f 40date 8506131627
fd0821e6 41.PP
86f03794
KB
42sets the date to June 13 1985, 4:27 PM. The year, month and day may
43be omitted; the default values will be the current ones. The system
44operates in GMT. \fIDate\fP takes care of the conversion to and from
3ceb636f
RG
45local standard and daylight-saving time.
46.PP
47If
48.I timed(8)
49is running to synchronize the clocks of machines in a local
50area network, \fIdate\fP sets the time globally on all those
ae320a28
MK
51machines unless the
52.B \-n
53option is given.
fd0821e6 54.SH FILES
3ceb636f
RG
55/usr/adm/wtmp to record time-setting.
56In /usr/adm/messages, \fIdate\fP records the name of the user
57setting the time.
fd0821e6 58.SH SEE ALSO
3ceb636f
RG
59gettimeofday(2), utmp(5), timed(8),
60.br
61\fITSP: The Time Synchronization Protocol for UNIX 4.3BSD\fP,
62R. Gusella and S. Zatti
fd0821e6 63.SH DIAGNOSTICS
9e59c384
JL
64Exit status is 0 on success, 1 on complete failure to set the date,
65and 2 on successfully setting the local date but failing globally.
66.PP
3ceb636f
RG
67Occasionally, when \fItimed\fP synchronizes the time on many hosts,
68the setting of a new time value may require more than a few seconds.
69On these occasions, \fIdate\fP prints: `Network time being set'.
70The message `Communication error with timed' occurs when the communication
71between \fIdate\fP and \fItimed\fP fails.
fd0821e6
KM
72.SH BUGS
73The system attempts to keep the date in a format closely compatible
74with VMS. VMS, however, uses local time (rather than GMT) and does
3ceb636f 75not understand daylight-saving time. Thus, if you use both UNIX
fd0821e6 76and VMS, VMS will be running on GMT.