doprnt.o is needed only on vax (need better way than this)
[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.\"
9e59c384 5.\" @(#)date.1 6.4 (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
ae320a28 13.RB "[ -n ] [ -u ] [ yymmddhhmm [ " . "ss ] ]"
fd0821e6 14.SH DESCRIPTION
e0f82482 15If no arguments are given, the current date and time are printed.
3ceb636f
RG
16Providing an argument will set the desired date.
17Only the superuser can set the date.
e0f82482
KM
18The
19.I -u
3ceb636f 20flag is used to display or set the date in GMT (universal) time.
fd0821e6 21.I yy
3ceb636f 22represents the last two digits of the year;
fd0821e6
KM
23the first
24.I mm
25is the month number;
26.I dd
3ceb636f 27is the day number;
fd0821e6
KM
28.I hh
29is the hour number (24 hour system);
30the second
31.I mm
32is the minute number;
33.BI . ss
3ceb636f 34is optional and represents the seconds.
fd0821e6
KM
35For example:
36.IP
3ceb636f 37date 8506131627
fd0821e6 38.PP
3ceb636f
RG
39sets the date to June 13 1985, 4:27 PM.
40The year, month and day may be omitted; the default
41values will be the current ones.
fd0821e6
KM
42The system operates in GMT.
43.I Date
44takes 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 67`You are not superuser: date not set' if you try to change the date
e0f82482 68but are not the super-user.
3ceb636f
RG
69Occasionally, when \fItimed\fP synchronizes the time on many hosts,
70the setting of a new time value may require more than a few seconds.
71On these occasions, \fIdate\fP prints: `Network time being set'.
72The message `Communication error with timed' occurs when the communication
73between \fIdate\fP and \fItimed\fP fails.
fd0821e6
KM
74.SH BUGS
75The system attempts to keep the date in a format closely compatible
76with VMS. VMS, however, uses local time (rather than GMT) and does
3ceb636f 77not understand daylight-saving time. Thus, if you use both UNIX
fd0821e6 78and VMS, VMS will be running on GMT.