8987 bootadm: add bootfile fallback to unix
[unleashed.git] / contrib / tzcode / date.1
blob579ab928dc19b00cd7e938ab34f452060efc46b2
1 .TH DATE 1
2 .SH NAME
3 date \- show and set date and time
4 .SH SYNOPSIS
5 .if n .nh
6 .if n .na
7 .ie \n(.g .ds - \f(CW-\fP
8 .el ds - \-
9 .B date
11 .B \*-u
12 ] [
13 .B \*-c
14 ] [
15 .B \*-r
16 .I seconds
17 ] [
18 .BI + format
19 ] [
20 \fR[\fIyyyy\fR]\fImmddhhmm\fR[\fIyy\fR][\fB.\fIss\fR]
22 .SH DESCRIPTION
23 .ie '\(lq'' .ds lq \&"\"
24 .el .ds lq \(lq\"
25 .ie '\(rq'' .ds rq \&"\"
26 .el .ds rq \(rq\"
27 .de q
28 \\$3\*(lq\\$1\*(rq\\$2
30 .I Date
31 without arguments writes the date and time to the standard output in
32 the form
33 .ce 1
34 Wed Mar  8 14:54:40 EST 1989
35 .br
36 with
37 .B EST
38 replaced by the local time zone's abbreviation
39 (or by the abbreviation for the time zone specified in the
40 .B TZ
41 environment variable if set).
42 The exact output format depends on the locale.
43 .PP
44 If a command-line argument starts with a plus sign (\c
45 .q "\fB+\fP" ),
46 the rest of the argument is used as a
47 .I format
48 that controls what appears in the output.
49 In the format, when a percent sign (\c
50 .q "\fB%\fP"
51 appears,
52 it and the character after it are not output,
53 but rather identify part of the date or time
54 to be output in a particular way
55 (or identify a special character to output):
56 .nf
57 .sp
58 .if t .in +.5i
59 .if n .in +2
60 .ta \w'%M\0\0'u +\w'Wed Mar  8 14:54:40 EST 1989\0\0'u
61         Sample output   Explanation
62 %a      Wed     Abbreviated weekday name*
63 %A      Wednesday       Full weekday name*
64 %b      Mar     Abbreviated month name*
65 %B      March   Full month name*
66 %c      Wed Mar 08 14:54:40 1989        Date and time*
67 %C      19      Century
68 %d      08      Day of month (always two digits)
69 %D      03/08/89        Month/day/year (eight characters)
70 %e       8      Day of month (leading zero blanked)
71 %h      Mar     Abbreviated month name*
72 %H      14      24-hour-clock hour (two digits)
73 %I      02      12-hour-clock hour (two digits)
74 %j      067     Julian day number (three digits)
75 %k       2      12-hour-clock hour (leading zero blanked)
76 %l      14      24-hour-clock hour (leading zero blanked)
77 %m      03      Month number (two digits)
78 %M      54      Minute (two digits)
79 %n      \\n     newline character
80 %p      PM      AM/PM designation
81 %r      02:54:40 PM     Hour:minute:second AM/PM designation
82 %R      14:54   Hour:minute
83 %S      40      Second (two digits)
84 %t      \\t     tab character
85 %T      14:54:40        Hour:minute:second
86 %U      10      Sunday-based week number (two digits)
87 %w      3       Day number (one digit, Sunday is 0)
88 %W      10      Monday-based week number (two digits)
89 %x      03/08/89        Date*
90 %X      14:54:40        Time*
91 %y      89      Last two digits of year
92 %Y      1989    Year in full
93 %z      -0500   Numeric time zone
94 %Z      EST     Time zone abbreviation
95 %+      Wed Mar  8 14:54:40 EST 1989    Default output format*
96 .if t .in -.5i
97 .if n .in -2
98 * The exact output depends on the locale.
99 .sp
101 If a character other than one of those shown above appears after
102 a percent sign in the format,
103 that following character is output.
104 All other characters in the format are copied unchanged to the output;
105 a newline character is always added at the end of the output.
107 In Sunday-based week numbering,
108 the first Sunday of the year begins week 1;
109 days preceding it are part of
110 .q "week 0" .
111 In Monday-based week numbering,
112 the first Monday of the year begins week 1.
114 To set the date, use a command line argument with one of the following forms:
116 .if t .in +.5i
117 .if n .in +2
118 .ta \w'198903081454\0'u
119 1454    24-hour-clock hours (first two digits) and minutes
120 081454  Month day (first two digits), hours, and minutes
121 03081454        Month (two digits, January is 01), month day, hours, minutes
122 8903081454      Year, month, month day, hours, minutes
123 0308145489      Month, month day, hours, minutes, year
124         (on System V-compatible systems)
125 030814541989    Month, month day, hours, minutes, four-digit year
126 198903081454    Four-digit year, month, month day, hours, minutes
127 .if t .in -.5i
128 .if n .in -2
130 If the century, year, month, or month day is not given,
131 the current value is used.
132 Any of the above forms may be followed by a period and two digits that give
133 the seconds part of the new time; if no seconds are given, zero is assumed.
135 These options are available:
137 .BR \*-u " or " \*-c
138 Use Universal Time when setting and showing the date and time.
140 .BI "\*-r " seconds
141 Output the date that corresponds to
142 .I seconds
143 past the epoch of 1970-01-01 00:00:00 UTC, where
144 .I seconds
145 should be an integer, either decimal, octal (leading 0), or
146 hexadecimal (leading 0x), preceded by an optional sign.
147 .SH FILES
148 .ta \w'/usr/local/etc/zoneinfo/posixrules\0\0'u
149 /usr/lib/locale/\f2L\fP/LC_TIME description of time locale \f2L\fP
151 /usr/local/etc/zoneinfo time zone information directory
153 /usr/local/etc/zoneinfo/localtime       local time zone file
155 /usr/local/etc/zoneinfo/posixrules      used with POSIX-style TZ's
157 /usr/local/etc/zoneinfo/GMT     for UTC leap seconds
160 .B /usr/local/etc/zoneinfo/GMT
161 is absent,
162 UTC leap seconds are loaded from
163 .BR /usr/local/etc/zoneinfo/posixrules .
164 .\" This file is in the public domain, so clarified as of
165 .\" 2009-05-17 by Arthur David Olson.