date.1 (139969) | date.1 (140353) |
---|---|
1.\"- 2.\" Copyright (c) 1980, 1990, 1993 3.\" The Regents of the University of California. All rights reserved. 4.\" 5.\" This code is derived from software contributed to Berkeley by 6.\" the Institute of Electrical and Electronics Engineers, Inc. 7.\" 8.\" Redistribution and use in source and binary forms, with or without --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)date.1 8.3 (Berkeley) 4/28/95 | 1.\"- 2.\" Copyright (c) 1980, 1990, 1993 3.\" The Regents of the University of California. All rights reserved. 4.\" 5.\" This code is derived from software contributed to Berkeley by 6.\" the Institute of Electrical and Electronics Engineers, Inc. 7.\" 8.\" Redistribution and use in source and binary forms, with or without --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)date.1 8.3 (Berkeley) 4/28/95 |
33.\" $FreeBSD: head/bin/date/date.1 139969 2005-01-10 08:39:26Z imp $ | 33.\" $FreeBSD: head/bin/date/date.1 140353 2005-01-16 16:41:59Z ru $ |
34.\" 35.Dd August 9, 2004 36.Dt DATE 1 37.Os 38.Sh NAME 39.Nm date 40.Nd display or set date and time 41.Sh SYNOPSIS --- 235 unchanged lines hidden (view full) --- 277Seconds, a number from 0 to 61 278(59 plus a maximum of two leap seconds). 279.El 280.Pp 281Everything but the minutes is optional. 282.Pp 283Time changes for Daylight Saving Time, standard time, leap seconds, 284and leap years are handled automatically. | 34.\" 35.Dd August 9, 2004 36.Dt DATE 1 37.Os 38.Sh NAME 39.Nm date 40.Nd display or set date and time 41.Sh SYNOPSIS --- 235 unchanged lines hidden (view full) --- 277Seconds, a number from 0 to 61 278(59 plus a maximum of two leap seconds). 279.El 280.Pp 281Everything but the minutes is optional. 282.Pp 283Time changes for Daylight Saving Time, standard time, leap seconds, 284and leap years are handled automatically. |
285.Sh ENVIRONMENT 286The following environment variables affect the execution of 287.Nm : 288.Bl -tag -width Ds 289.It Ev TZ 290The timezone to use when displaying dates. 291The normal format is a pathname relative to 292.Pa /usr/share/zoneinfo . 293For example, the command 294.Dq TZ=America/Los_Angeles date 295displays the current time in California. 296See 297.Xr environ 7 298for more information. 299.El 300.Sh FILES 301.Bl -tag -width /var/log/messages -compact 302.It Pa /var/log/wtmp 303record of date resets and time changes 304.It Pa /var/log/messages 305record of the user setting the time 306.El 307.Sh EXIT STATUS 308The 309.Nm 310utility exits 0 on success, 1 if unable to set the date, and 2 311if able to set the local date, but unable to set it globally. |
|
285.Sh EXAMPLES 286The command: 287.Pp 288.Dl "date ""+DATE: %Y-%m-%d%nTIME: %H:%M:%S""" 289.Pp 290will display: 291.Bd -literal -offset indent 292DATE: 1987-11-21 --- 61 unchanged lines hidden (view full) --- 354.Pp 355Finally the command: 356.Pp 357.Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`date`"" ""+%s""" 358.Pp 359can be used to parse the output from 360.Nm 361and express it in Epoch time. | 312.Sh EXAMPLES 313The command: 314.Pp 315.Dl "date ""+DATE: %Y-%m-%d%nTIME: %H:%M:%S""" 316.Pp 317will display: 318.Bd -literal -offset indent 319DATE: 1987-11-21 --- 61 unchanged lines hidden (view full) --- 381.Pp 382Finally the command: 383.Pp 384.Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`date`"" ""+%s""" 385.Pp 386can be used to parse the output from 387.Nm 388and express it in Epoch time. |
362.Sh ENVIRONMENT 363The following environment variables affect the execution of 364.Nm : 365.Bl -tag -width Ds 366.It Ev TZ 367The timezone to use when displaying dates. 368The normal format is a pathname relative to 369.Pa /usr/share/zoneinfo . 370For example, the command 371.Dq TZ=America/Los_Angeles date 372displays the current time in California. 373See 374.Xr environ 7 375for more information. 376.El 377.Sh FILES 378.Bl -tag -width /var/log/messages -compact 379.It Pa /var/log/wtmp 380record of date resets and time changes 381.It Pa /var/log/messages 382record of the user setting the time 383.El 384.Sh SEE ALSO 385.Xr gettimeofday 2 , 386.Xr strftime 3 , 387.Xr strptime 3 , 388.Xr utmp 5 , 389.Xr timed 8 390.Rs 391.%T "TSP: The Time Synchronization Protocol for UNIX 4.3BSD" 392.%A R. Gusella 393.%A S. Zatti 394.Re | |
395.Sh DIAGNOSTICS | 389.Sh DIAGNOSTICS |
396The 397.Nm 398utility exits 0 on success, 1 if unable to set the date, and 2 399if able to set the local date, but unable to set it globally. 400.Pp | |
401Occasionally, when 402.Xr timed 8 403synchronizes the time on many hosts, the setting of a new time value may 404require more than a few seconds. 405On these occasions, 406.Nm 407prints: 408.Ql Network time being set . 409The message 410.Ql Communication error with timed 411occurs when the communication 412between 413.Nm 414and 415.Xr timed 8 416fails. | 390Occasionally, when 391.Xr timed 8 392synchronizes the time on many hosts, the setting of a new time value may 393require more than a few seconds. 394On these occasions, 395.Nm 396prints: 397.Ql Network time being set . 398The message 399.Ql Communication error with timed 400occurs when the communication 401between 402.Nm 403and 404.Xr timed 8 405fails. |
406.Sh SEE ALSO 407.Xr gettimeofday 2 , 408.Xr strftime 3 , 409.Xr strptime 3 , 410.Xr utmp 5 , 411.Xr timed 8 412.Rs 413.%T "TSP: The Time Synchronization Protocol for UNIX 4.3BSD" 414.%A R. Gusella 415.%A S. Zatti 416.Re |
|
417.Sh STANDARDS 418The 419.Nm 420utility is expected to be compatible with 421.St -p1003.2 . 422.Sh HISTORY 423A 424.Nm 425command appeared in 426.At v1 . | 417.Sh STANDARDS 418The 419.Nm 420utility is expected to be compatible with 421.St -p1003.2 . 422.Sh HISTORY 423A 424.Nm 425command appeared in 426.At v1 . |