| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: date.1,v 1.52 2023/05/31 16:01:53 kim Exp $ | | 1 | .\" $NetBSD: date.1,v 1.53 2023/05/31 17:52:02 uwe Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1980, 1990, 1993 | | 3 | .\" Copyright (c) 1980, 1990, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to Berkeley by | | 6 | .\" This code is derived from software contributed to Berkeley by |
7 | .\" the Institute of Electrical and Electronics Engineers, Inc. | | 7 | .\" the Institute of Electrical and Electronics Engineers, Inc. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -46,60 +46,60 @@ | | | @@ -46,60 +46,60 @@ |
46 | .Op Cm + Ns Ar format | | 46 | .Op Cm + Ns Ar format |
47 | .Sm off | | 47 | .Sm off |
48 | .Oo Oo Oo Oo Oo Oo | | 48 | .Oo Oo Oo Oo Oo Oo |
49 | .Ar CC Oc | | 49 | .Ar CC Oc |
50 | .Ar yy Oc | | 50 | .Ar yy Oc |
51 | .Ar mm Oc | | 51 | .Ar mm Oc |
52 | .Ar dd Oc | | 52 | .Ar dd Oc |
53 | .Ar HH Oc Ar MM Oo | | 53 | .Ar HH Oc Ar MM Oo |
54 | .Li \&. Ar SS Oc Oc | | 54 | .Li \&. Ar SS Oc Oc |
55 | .Sm on | | 55 | .Sm on |
56 | .Nm | | 56 | .Nm |
57 | .Op Fl ajnRu | | 57 | .Op Fl ajnRu |
58 | .Fl f Ar input_format | | 58 | .Fl f Ar input_format |
59 | new_date | | 59 | .Ar new_date |
60 | .Op Cm + Ns Ar format | | 60 | .Op Cm + Ns Ar format |
61 | .Sh DESCRIPTION | | 61 | .Sh DESCRIPTION |
62 | .Nm | | 62 | .Nm |
63 | displays the current date and time when invoked without arguments. | | 63 | displays the current date and time when invoked without arguments. |
64 | Providing arguments will format the date and time in a user-defined | | 64 | Providing arguments will format the date and time in a user-defined |
65 | way or set the date. | | 65 | way or set the date. |
66 | Only the superuser may set the date. | | 66 | Only the superuser may set the date. |
67 | .Pp | | 67 | .Pp |
68 | The options are as follows: | | 68 | The options are as follows: |
69 | .Bl -tag -width 12n | | 69 | .Bl -tag -width Fl |
70 | .It Fl a | | 70 | .It Fl a |
71 | Use | | 71 | Use |
72 | .Xr adjtime 2 | | 72 | .Xr adjtime 2 |
73 | to change the local system time slowly, | | 73 | to change the local system time slowly, |
74 | maintaining it as a monotonically increasing function. | | 74 | maintaining it as a monotonically increasing function. |
75 | .Fl a | | 75 | .Fl a |
76 | implies | | 76 | implies |
77 | .Fl n . | | 77 | .Fl n . |
78 | .It Fl d Ar date | | 78 | .It Fl d Ar date |
79 | Parse the provided human-described date and time and display the result without | | 79 | Parse the provided human-described date and time and display the result without |
80 | actually changing the system clock. | | 80 | actually changing the system clock. |
81 | (See | | 81 | (See |
82 | .Xr parsedate 3 | | 82 | .Xr parsedate 3 |
83 | for examples.) | | 83 | for examples.) |
84 | .It Fl f Ar input_fmt | | 84 | .It Fl f Ar input_fmt |
85 | Use | | 85 | Use |
86 | .Ar input_fmt | | 86 | .Ar input_fmt |
87 | as the format string to parse the | | 87 | as the format string to parse the |
88 | .Ar new_date | | 88 | .Ar new_date |
89 | provided rather than using the default | | 89 | provided rather than using the default |
90 | .Sm off | | 90 | .Sm off |
91 | .Oo Oo Oo Oo Oo | | 91 | .Oo Oo Oo Oo Oo |
92 | .Ar cc Oc | | 92 | .Ar CC Oc |
93 | .Ar yy Oc | | 93 | .Ar yy Oc |
94 | .Ar mm Oc | | 94 | .Ar mm Oc |
95 | .Ar dd Oc | | 95 | .Ar dd Oc |
96 | .Ar HH | | 96 | .Ar HH |
97 | .Oc Ar MM Op Cm \&. Ar SS | | 97 | .Oc Ar MM Op Cm \&. Ar SS |
98 | .Sm on | | 98 | .Sm on |
99 | format. | | 99 | format. |
100 | Parsing is done using | | 100 | Parsing is done using |
101 | .Xr strptime 3 . | | 101 | .Xr strptime 3 . |
102 | .It Fl j | | 102 | .It Fl j |
103 | Parse the provided canonical representation of date and time (described below) | | 103 | Parse the provided canonical representation of date and time (described below) |
104 | and display the result without actually changing the system clock. | | 104 | and display the result without actually changing the system clock. |
105 | .It Fl n | | 105 | .It Fl n |
| @@ -125,27 +125,29 @@ Print out the date and time that is | | | @@ -125,27 +125,29 @@ Print out the date and time that is |
125 | from the Epoch. | | 125 | from the Epoch. |
126 | .It Fl u | | 126 | .It Fl u |
127 | Display or set the date in UTC (universal) time. | | 127 | Display or set the date in UTC (universal) time. |
128 | .El | | 128 | .El |
129 | .Pp | | 129 | .Pp |
130 | An operand with a leading plus | | 130 | An operand with a leading plus |
131 | .Pq Cm + | | 131 | .Pq Cm + |
132 | sign signals a user-defined format | | 132 | sign signals a user-defined format |
133 | string which specifies the format in which to display the date and time. | | 133 | string which specifies the format in which to display the date and time. |
134 | The format string may contain any of the conversion specifications described | | 134 | The format string may contain any of the conversion specifications described |
135 | in the | | 135 | in the |
136 | .Xr strftime 3 | | 136 | .Xr strftime 3 |
137 | manual page, as well as any arbitrary text. | | 137 | manual page, as well as any arbitrary text. |
138 | A <newline> character is always output after the characters | | 138 | A |
| | | 139 | .Aq newline |
| | | 140 | character is always output after the characters |
139 | specified by the format string. | | 141 | specified by the format string. |
140 | The format string for the default display is: | | 142 | The format string for the default display is: |
141 | .Pp | | 143 | .Pp |
142 | .Dl %a %b %e %H:%M:%S %Z %Y | | 144 | .Dl %a %b %e %H:%M:%S %Z %Y |
143 | .Pp | | 145 | .Pp |
144 | If an operand does not have a leading plus sign, it is interpreted as | | 146 | If an operand does not have a leading plus sign, it is interpreted as |
145 | a value for setting the system's notion of the current date and time. | | 147 | a value for setting the system's notion of the current date and time. |
146 | The canonical representation for setting the date and time is: | | 148 | The canonical representation for setting the date and time is: |
147 | .Pp | | 149 | .Pp |
148 | .Bl -tag -width Ds -compact -offset indent | | 150 | .Bl -tag -width Ds -compact -offset indent |
149 | .It Ar CC | | 151 | .It Ar CC |
150 | The first two digits of the year (the century). | | 152 | The first two digits of the year (the century). |
151 | .It Ar yy | | 153 | .It Ar yy |
| @@ -171,41 +173,42 @@ The hour of the day, from 00 to 23. | | | @@ -171,41 +173,42 @@ The hour of the day, from 00 to 23. |
171 | .It Ar MM | | 173 | .It Ar MM |
172 | The minute of the hour, from 00 to 59. | | 174 | The minute of the hour, from 00 to 59. |
173 | .It Ar SS | | 175 | .It Ar SS |
174 | The second of the minute, from 00 to 60. | | 176 | The second of the minute, from 00 to 60. |
175 | .El | | 177 | .El |
176 | .Pp | | 178 | .Pp |
177 | Everything but the minutes is optional. | | 179 | Everything but the minutes is optional. |
178 | .Pp | | 180 | .Pp |
179 | Time changes for Daylight Saving and Standard Time and leap seconds | | 181 | Time changes for Daylight Saving and Standard Time and leap seconds |
180 | and years are handled automatically. | | 182 | and years are handled automatically. |
181 | .Sh ENVIRONMENT | | 183 | .Sh ENVIRONMENT |
182 | The following environment variables affect the execution of | | 184 | The following environment variables affect the execution of |
183 | .Nm : | | 185 | .Nm : |
184 | .Bl -tag -width iTZ | | 186 | .Bl -tag -width Ev |
185 | .It Ev TZ | | 187 | .It Ev TZ |
186 | The timezone to use when displaying dates. | | 188 | The timezone to use when displaying dates. |
187 | See | | 189 | See |
188 | .Xr environ 7 | | 190 | .Xr environ 7 |
189 | for more information. | | 191 | for more information. |
190 | .El | | 192 | .El |
191 | .Sh FILES | | 193 | .Sh FILES |
192 | .Bl -tag -width /usr/share/zoneinfo/posixrules -compact | | 194 | .Bl -tag -width Pa -compact |
193 | .It Pa /etc/localtime | | 195 | .It Pa /etc/localtime |
194 | Symlink pointing to system's default timezone information file in | | 196 | Symlink pointing to system's default timezone information file in |
195 | .Pa /usr/share/zoneinfo | | 197 | .Pa /usr/share/zoneinfo |
196 | directory. | | 198 | directory. |
197 | .It Pa /usr/lib/locale/<L>/LC_TIME | | 199 | .It Pa /usr/lib/locale/ Ns Ao Ar L Ac Ns Pa /LC_TIME |
198 | Description of time locale <L>. | | 200 | Description of time locale |
| | | 201 | .Aq Ar L . |
199 | .It Pa /usr/share/zoneinfo | | 202 | .It Pa /usr/share/zoneinfo |
200 | Time zone information directory. | | 203 | Time zone information directory. |
201 | .It Pa /usr/share/zoneinfo/posixrules | | 204 | .It Pa /usr/share/zoneinfo/posixrules |
202 | Used with POSIX-style TZ's. | | 205 | Used with POSIX-style TZ's. |
203 | .It Pa /usr/share/zoneinfo/GMT | | 206 | .It Pa /usr/share/zoneinfo/GMT |
204 | For UTC leap seconds. | | 207 | For UTC leap seconds. |
205 | .It Pa /var/log/wtmp | | 208 | .It Pa /var/log/wtmp |
206 | A record of date resets and time changes. | | 209 | A record of date resets and time changes. |
207 | .It Pa /var/log/messages | | 210 | .It Pa /var/log/messages |
208 | A record of the user setting the time. | | 211 | A record of the user setting the time. |
209 | .El | | 212 | .El |
210 | .Pp | | 213 | .Pp |
211 | If | | 214 | If |