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