|
Lines 35-41
Link Here
|
| 35 |
.\" @(#)date.1 8.3 (Berkeley) 4/28/95 |
35 |
.\" @(#)date.1 8.3 (Berkeley) 4/28/95 |
| 36 |
.\" $FreeBSD: src/bin/date/date.1,v 1.31 1999/08/27 23:13:58 peter Exp $ |
36 |
.\" $FreeBSD: src/bin/date/date.1,v 1.31 1999/08/27 23:13:58 peter Exp $ |
| 37 |
.\" |
37 |
.\" |
| 38 |
.Dd November 17, 1993 |
38 |
.Dd April 28, 1995 |
| 39 |
.Dt DATE 1 |
39 |
.Dt DATE 1 |
| 40 |
.Os |
40 |
.Os |
| 41 |
.Sh NAME |
41 |
.Sh NAME |
|
Lines 49-74
Link Here
|
| 49 |
.Op Fl t Ar minutes_west |
49 |
.Op Fl t Ar minutes_west |
| 50 |
.Op Fl v Ns Ar [+|-]val Ns Op ymwdHMS |
50 |
.Op Fl v Ns Ar [+|-]val Ns Op ymwdHMS |
| 51 |
.Ar ... |
51 |
.Ar ... |
| 52 |
.Op Fl f Ar fmt Ar date | [[[[yy]mm]dd]HH]MM[\&.ss] |
52 |
.Op Fl f Ar fmt Ar date | [[[[[cc]yy]mm]dd]HH]MM[\&.ss] |
| 53 |
.Op Cm + Ns Ar format |
53 |
.Op Cm + Ns Ar format |
| 54 |
.Sh DESCRIPTION |
54 |
.Sh DESCRIPTION |
| 55 |
.Nm Date |
55 |
When invoked without arguments, the |
| 56 |
displays the current date and time when invoked without arguments. |
56 |
.Nm |
| 57 |
Providing arguments will format the date and time in a user-defined |
57 |
utility displays the current date and time. |
| 58 |
way or set the date. |
58 |
Otherwise, depending on the options specified, |
| 59 |
Only the superuser may set the date. |
59 |
.Nm |
|
|
60 |
will set the date and time or print it in a user-defined way. |
| 61 |
.Pp |
| 62 |
Only the super-user may set the date. |
| 60 |
.Pp |
63 |
.Pp |
| 61 |
The options are as follows: |
64 |
The options are as follows: |
| 62 |
.Bl -tag -width Ds |
65 |
.Bl -tag -width Ds |
| 63 |
.It Fl d |
66 |
.It Fl d Ar dst |
| 64 |
Set the kernel's value for daylight savings time. |
67 |
Set the kernel's value for daylight saving time. |
| 65 |
If |
68 |
If |
| 66 |
.Ar dst |
69 |
.Ar dst |
| 67 |
is non-zero, future calls |
70 |
is non-zero, future calls |
| 68 |
to |
71 |
to |
| 69 |
.Xr gettimeofday 2 |
72 |
.Xr gettimeofday 2 |
| 70 |
will return a non-zero |
73 |
will return a non-zero |
| 71 |
.Ql tz_dsttime . |
74 |
.Ql tz_dsttime . |
| 72 |
.It Fl f |
75 |
.It Fl f |
| 73 |
Use |
76 |
Use |
| 74 |
.Ar fmt |
77 |
.Ar fmt |
|
Lines 88-94
Link Here
|
| 88 |
.Xr timed 8 |
91 |
.Xr timed 8 |
| 89 |
is used to synchronize the clocks on groups of machines. |
92 |
is used to synchronize the clocks on groups of machines. |
| 90 |
By default, if |
93 |
By default, if |
| 91 |
.Xr timed |
94 |
.Xr timed 8 |
| 92 |
is running, |
95 |
is running, |
| 93 |
.Nm |
96 |
.Nm |
| 94 |
will set the time on all of the machines in the local group. |
97 |
will set the time on all of the machines in the local group. |
|
Lines 97-119
Link Here
|
| 97 |
option stops |
100 |
option stops |
| 98 |
.Nm |
101 |
.Nm |
| 99 |
from setting the time for other than the current machine. |
102 |
from setting the time for other than the current machine. |
| 100 |
.It Fl r |
103 |
.It Fl r Ar seconds |
| 101 |
Print out the date and time in |
104 |
Print out (in specified format) the date and time represented by |
| 102 |
.Ar seconds |
105 |
.Ar seconds |
| 103 |
from the Epoch. |
106 |
from the Epoch. |
| 104 |
.It Fl t |
107 |
.It Fl t Ar minutes_west |
| 105 |
Set the kernel's value for minutes west of |
108 |
Set the kernel's value for minutes west of |
| 106 |
.Tn GMT . |
109 |
.Tn GMT . |
| 107 |
.Ar Minutes_west |
110 |
.Ar minutes_west |
| 108 |
specifies the number of minutes returned in |
111 |
specifies the number of minutes returned in |
| 109 |
.Ql tz_minuteswest |
112 |
.Ql tz_minuteswest |
| 110 |
by future calls to |
113 |
by future calls to |
| 111 |
.Xr gettimeofday 2 . |
114 |
.Xr gettimeofday 2 . |
| 112 |
.It Fl u |
115 |
.It Fl u |
| 113 |
Display or set the date in |
116 |
Display or set the date in |
| 114 |
.Tn UCT |
117 |
.Tn UTC |
| 115 |
(universal) time. |
118 |
(universal) time. |
| 116 |
.It Fl v |
119 |
.It Fl v Ns Ar [+|-]val Ns Op ymwdHMS |
| 117 |
Adjust the second, minute, hour, month day, week day, month or year according to |
120 |
Adjust the second, minute, hour, month day, week day, month or year according to |
| 118 |
.Ar val . |
121 |
.Ar val . |
| 119 |
If |
122 |
If |
|
Lines 150-159
Link Here
|
| 150 |
Refer to the examples below for further details. |
153 |
Refer to the examples below for further details. |
| 151 |
.El |
154 |
.El |
| 152 |
.Pp |
155 |
.Pp |
| 153 |
An operand with a leading plus (``+'') sign signals a user-defined format |
156 |
An operand with a leading plus sign |
|
|
157 |
.Pq Sq + |
| 158 |
signals a user-defined format |
| 154 |
string which specifies the format in which to display the date and time. |
159 |
string which specifies the format in which to display the date and time. |
| 155 |
The format string may contain any of the conversion specifications described |
160 |
The format string may contain any of the conversion specifications described |
| 156 |
in the |
161 |
in the |
| 157 |
.Xr strftime 3 |
162 |
.Xr strftime 3 |
| 158 |
manual page, as well as any arbitrary text. |
163 |
manual page, as well as any arbitrary text. |
| 159 |
A <newline> character is always output after the characters specified by |
164 |
A <newline> character is always output after the characters specified by |
|
Lines 169-192
Link Here
|
| 169 |
.Pp |
174 |
.Pp |
| 170 |
.Bl -tag -width Ds -compact -offset indent |
175 |
.Bl -tag -width Ds -compact -offset indent |
| 171 |
.It Ar yy |
176 |
.It Ar yy |
| 172 |
Year in abbreviated form (e.g. 89 for 1989, 06 for 2006). |
177 |
Year in abbreviated form (for years falling within 1969\(em2068). |
|
|
178 |
The format |
| 179 |
.Ar ccyymmddHHMM |
| 180 |
is also permitted, for non-ambiguous years. |
| 173 |
.It Ar mm |
181 |
.It Ar mm |
| 174 |
Numeric month. |
182 |
Numeric month, a number from 1 to 12. |
| 175 |
A number from 1 to 12. |
|
|
| 176 |
.It Ar dd |
183 |
.It Ar dd |
| 177 |
Day, a number from 1 to 31. |
184 |
Day, a number from 1 to 31. |
| 178 |
.It Ar HH |
185 |
.It Ar HH |
| 179 |
Hour, a number from 0 to 23. |
186 |
Hour, a number from 0 to 23. |
| 180 |
.It Ar MM |
187 |
.It Ar MM |
| 181 |
Minutes, a number from 0 to 59. |
188 |
Minute, a number from 0 to 59. |
| 182 |
.It Ar .ss |
189 |
.It Ar .SS |
| 183 |
Seconds, a number from 0 to 61 (59 plus a maximum of two leap seconds). |
190 |
Second, a number from 0 to 61 (59 plus a maximum of two leap seconds). |
| 184 |
.El |
191 |
.El |
| 185 |
.Pp |
192 |
.Pp |
| 186 |
Everything but the minutes is optional. |
193 |
Everything but the minute is optional. |
| 187 |
.Pp |
194 |
.Pp |
| 188 |
Time changes for Daylight Saving and Standard time and leap seconds |
195 |
Time changes for daylight saving time, standard time, leap seconds, |
| 189 |
and years are handled automatically. |
196 |
and leap years are handled automatically. |
| 190 |
.Sh EXAMPLES |
197 |
.Sh EXAMPLES |
| 191 |
The command: |
198 |
The command: |
| 192 |
.Bd -literal -offset indent |
199 |
.Bd -literal -offset indent |
|
Lines 250-258
Link Here
|
| 250 |
.Li "2:32 PM" , |
257 |
.Li "2:32 PM" , |
| 251 |
without modifying the date. |
258 |
without modifying the date. |
| 252 |
.Sh ENVIRONMENT |
259 |
.Sh ENVIRONMENT |
| 253 |
The execution of |
260 |
The following environment variables affect the execution of |
| 254 |
.Nm |
261 |
.Nm date : |
| 255 |
is affected by the following environment variables: |
|
|
| 256 |
.Bl -tag -width Ds |
262 |
.Bl -tag -width Ds |
| 257 |
.It Ev TZ |
263 |
.It Ev TZ |
| 258 |
The timezone to use when displaying dates. |
264 |
The timezone to use when displaying dates. |
|
Lines 268-276
Link Here
|
| 268 |
.Sh FILES |
274 |
.Sh FILES |
| 269 |
.Bl -tag -width /var/log/messages -compact |
275 |
.Bl -tag -width /var/log/messages -compact |
| 270 |
.It Pa /var/log/wtmp |
276 |
.It Pa /var/log/wtmp |
| 271 |
a record of date resets and time changes |
277 |
record of date resets and time changes |
| 272 |
.It Pa /var/log/messages |
278 |
.It Pa /var/log/messages |
| 273 |
a record of the user setting the time |
279 |
record of the user setting the time |
| 274 |
.El |
280 |
.El |
| 275 |
.Sh SEE ALSO |
281 |
.Sh SEE ALSO |
| 276 |
.Xr gettimeofday 2 , |
282 |
.Xr gettimeofday 2 , |
|
Lines 290-314
Link Here
|
| 290 |
if able to set the local date, but unable to set it globally. |
296 |
if able to set the local date, but unable to set it globally. |
| 291 |
.Pp |
297 |
.Pp |
| 292 |
Occasionally, when |
298 |
Occasionally, when |
| 293 |
.Xr timed |
299 |
.Xr timed 8 |
| 294 |
synchronizes the time on many hosts, the setting of a new time value may |
300 |
synchronizes the time on many hosts, the setting of a new time value may |
| 295 |
require more than a few seconds. |
301 |
require more than a few seconds. |
| 296 |
On these occasions, |
302 |
On these occasions, |
| 297 |
.Nm |
303 |
.Nm |
| 298 |
prints: |
304 |
prints: |
| 299 |
.Ql Network time being set . |
305 |
.Dq Network time being set . |
| 300 |
The message |
306 |
The message |
| 301 |
.Ql Communication error with timed |
307 |
.Dq Communication error with timed |
| 302 |
occurs when the communication |
308 |
occurs when the communication |
| 303 |
between |
309 |
between |
| 304 |
.Nm |
310 |
.Nm |
| 305 |
and |
311 |
and |
| 306 |
.Xr timed |
312 |
.Xr timed 8 |
| 307 |
fails. |
313 |
fails. |
| 308 |
.Sh STANDARDS |
314 |
.Sh STANDARDS |
| 309 |
The |
315 |
The |
| 310 |
.Nm |
316 |
.Nm |
| 311 |
command is expected to be compatible with |
317 |
utility is expected to be compatible with |
| 312 |
.St -p1003.2 . |
318 |
.St -p1003.2 . |
| 313 |
.Sh HISTORY |
319 |
.Sh HISTORY |
| 314 |
A |
320 |
A |