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