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