Debian Codegraph @

upstream/debian-trixie/man1/date.1

raw
1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.50.1.
2 .TH DATE "1" "June 2025" "GNU coreutils 9.7" "User Commands"
3 .\" Define monospaced roman font for groff in troff mode.
4 .if t .if \n(.g \{\
5 . ds mono \f(CR
6 . ds /mono \fP
7 .\}
8 .SH NAME
9 date \- print or set the system date and time
10 .SH SYNOPSIS
11 .B date
12 [\fI\,OPTION\/\fR]... [\fI\,+FORMAT\/\fR]
13 .br
14 .B date
15 [\fI\,-u|--utc|--universal\/\fR] [\fI\,MMDDhhmm\/\fR[[\fI\,CC\/\fR]\fI\,YY\/\fR][\fI\,.ss\/\fR]]
16 .SH DESCRIPTION
17 .\" Add any additional description here
18 .PP
19 Display date and time in the given FORMAT.
20 With \fB\-s\fR, or with [MMDDhhmm[[CC]YY][.ss]], set the date and time.
21 .PP
22 Mandatory arguments to long options are mandatory for short options too.
23 .TP
24 \fB\-d\fR, \fB\-\-date\fR=\fI\,STRING\/\fR
25 display time described by STRING, not 'now'
26 .TP
27 \fB\-\-debug\fR
28 annotate the parsed date,
29 and warn about questionable usage to stderr
30 .TP
31 \fB\-f\fR, \fB\-\-file\fR=\fI\,DATEFILE\/\fR
32 like \fB\-\-date\fR; once for each line of DATEFILE
33 .TP
34 \fB\-I[FMT]\fR, \fB\-\-iso\-8601\fR[=\fI\,FMT\/\fR]
35 output date/time in ISO 8601 format.
36 FMT='date' for date only (the default),
37 \&'hours', 'minutes', 'seconds', or 'ns'
38 for date and time to the indicated precision.
39 Example: 2006\-08\-14T02:34:56\-06:00
40 .TP
41 \fB\-\-resolution\fR
42 output the available resolution of timestamps
43 Example: 0.000000001
44 .TP
45 \fB\-R\fR, \fB\-\-rfc\-email\fR
46 output date and time in RFC 5322 format.
47 Example: Mon, 14 Aug 2006 02:34:56 \fB\-0600\fR
48 .TP
49 \fB\-\-rfc\-3339\fR=\fI\,FMT\/\fR
50 output date/time in RFC 3339 format.
51 FMT='date', 'seconds', or 'ns'
52 for date and time to the indicated precision.
53 Example: 2006\-08\-14 02:34:56\-06:00
54 .TP
55 \fB\-r\fR, \fB\-\-reference\fR=\fI\,FILE\/\fR
56 display the last modification time of FILE
57 .TP
58 \fB\-s\fR, \fB\-\-set\fR=\fI\,STRING\/\fR
59 set time described by STRING
60 .TP
61 \fB\-u\fR, \fB\-\-utc\fR, \fB\-\-universal\fR
62 print or set Coordinated Universal Time (UTC)
63 .TP
64 \fB\-\-help\fR
65 display this help and exit
66 .TP
67 \fB\-\-version\fR
68 output version information and exit
69 .PP
70 All options that specify the date to display are mutually exclusive.
71 I.e.: \fB\-\-date\fR, \fB\-\-file\fR, \fB\-\-reference\fR, \fB\-\-resolution\fR.
72 .PP
73 FORMAT controls the output. Interpreted sequences are:
74 .TP
75 %%
76 a literal %
77 .TP
78 %a
79 locale's abbreviated weekday name (e.g., Sun)
80 .TP
81 %A
82 locale's full weekday name (e.g., Sunday)
83 .TP
84 %b
85 locale's abbreviated month name (e.g., Jan)
86 .TP
87 %B
88 locale's full month name (e.g., January)
89 .TP
90 %c
91 locale's date and time (e.g., Thu Mar 3 23:05:25 2005)
92 .TP
93 %C
94 century; like %Y, except omit last two digits (e.g., 20)
95 .TP
96 %d
97 day of month (e.g., 01)
98 .TP
99 %D
100 date (ambiguous); same as %m/%d/%y
101 .TP
102 %e
103 day of month, space padded; same as %_d
104 .TP
105 %F
106 full date; like %+4Y\-%m\-%d
107 .TP
108 %g
109 last two digits of year of ISO week number (ambiguous; 00\-99); see %G
110 .TP
111 %G
112 year of ISO week number; normally useful only with %V
113 .TP
114 %h
115 same as %b
116 .TP
117 %H
118 hour (00..23)
119 .TP
120 %I
121 hour (01..12)
122 .TP
123 %j
124 day of year (001..366)
125 .TP
126 %k
127 hour, space padded ( 0..23); same as %_H
128 .TP
129 %l
130 hour, space padded ( 1..12); same as %_I
131 .TP
132 %m
133 month (01..12)
134 .TP
135 %M
136 minute (00..59)
137 .TP
138 %n
139 a newline
140 .TP
141 %N
142 nanoseconds (000000000..999999999)
143 .TP
144 %p
145 locale's equivalent of either AM or PM; blank if not known
146 .TP
147 %P
148 like %p, but lower case
149 .TP
150 %q
151 quarter of year (1..4)
152 .TP
153 %r
154 locale's 12\-hour clock time (e.g., 11:11:04 PM)
155 .TP
156 %R
157 24\-hour hour and minute; same as %H:%M
158 .TP
159 %s
160 seconds since the Epoch (1970\-01\-01 00:00 UTC)
161 .TP
162 %S
163 second (00..60)
164 .TP
165 %t
166 a tab
167 .TP
168 %T
169 time; same as %H:%M:%S
170 .TP
171 %u
172 day of week (1..7); 1 is Monday
173 .TP
174 %U
175 week number of year, with Sunday as first day of week (00..53)
176 .TP
177 %V
178 ISO week number, with Monday as first day of week (01..53)
179 .TP
180 %w
181 day of week (0..6); 0 is Sunday
182 .TP
183 %W
184 week number of year, with Monday as first day of week (00..53)
185 .TP
186 %x
187 locale's date (can be ambiguous; e.g., 12/31/99)
188 .TP
189 %X
190 locale's time representation (e.g., 23:13:48)
191 .TP
192 %y
193 last two digits of year (ambiguous; 00..99)
194 .TP
195 %Y
196 year
197 .TP
198 %z
199 +hhmm numeric time zone (e.g., \fB\-0400\fR)
200 .TP
201 %:z
202 +hh:mm numeric time zone (e.g., \fB\-04\fR:00)
203 .TP
204 %::z
205 +hh:mm:ss numeric time zone (e.g., \fB\-04\fR:00:00)
206 .TP
207 %:::z
208 numeric time zone with : to necessary precision (e.g., \fB\-04\fR, +05:30)
209 .TP
210 %Z
211 alphabetic time zone abbreviation (e.g., EDT)
212 .PP
213 By default, date pads numeric fields with zeroes.
214 The following optional flags may follow '%':
215 .TP
216 \-
217 (hyphen) do not pad the field
218 .TP
219 _
220 (underscore) pad with spaces
221 .TP
222 0
223 (zero) pad with zeros
224 .TP
225 +
226 pad with zeros, and put '+' before future years with >4 digits
227 .TP
228 ^
229 use upper case if possible
230 .TP
231 #
232 use opposite case if possible
233 .PP
234 After any flags comes an optional field width, as a decimal number;
235 then an optional modifier, which is either
236 E to use the locale's alternate representations if available, or
237 O to use the locale's alternate numeric symbols if available.
238 .SH EXAMPLES
239 Convert seconds since the Epoch (1970\-01\-01 UTC) to a date
240 .IP
241 \*[mono]$ date --date='@2147483647'\*[/mono]
242 .PP
243 Show the time on the west coast of the US (use \fBtzselect\fP(1) to find TZ)
244 .IP
245 \*[mono]$ TZ='America/Los_Angeles' date\*[/mono]
246 .PP
247 Show the local time for 9AM next Friday on the west coast of the US
248 .IP
249 \*[mono]$ date --date='TZ="America/Los_Angeles" 09:00 next Fri'\*[/mono]
250 .SH "DATE STRING"
251 .\" NOTE: keep this paragraph in sync with the one in touch.x
252 The --date=STRING is a mostly free format human readable date string
253 such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or
254 even "next Thursday". A date string may contain items indicating
255 calendar date, time of day, time zone, day of week, relative time,
256 relative date, and numbers. An empty string indicates the beginning
257 of the day. The date string format is more complex than is easily
258 documented here but is fully described in the info documentation.
259 .SH AUTHOR
260 Written by David MacKenzie.
261 .SH "REPORTING BUGS"
262 GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
263 .br
264 Report any translation bugs to <https://translationproject.org/team/>
265 .SH "SEE ALSO"
266 Full documentation <https://www.gnu.org/software/coreutils/date>
267 .br
268 or available locally via: info \(aq(coreutils) date invocation\(aq
269 .PP
270 .br
271 Packaged by Debian (9.7\-3)
272 .br
273 Copyright \(co 2025 Free Software Foundation, Inc.
274 .br
275 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
276 .br
277 This is free software: you are free to change and redistribute it.
278 .br
279 There is NO WARRANTY, to the extent permitted by law.