1DATE(1) User Commands DATE(1)
2
3
4
6 date - print or set the system date and time
7
9 date [OPTION]... [+FORMAT]
10 date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
11
13 Display the current time in the given FORMAT, or set the system date.
14
15 -d, --date=STRING
16 display time described by STRING, not `now'
17
18 -f, --file=DATEFILE
19 like --date once for each line of DATEFILE
20
21 -r, --reference=FILE
22 display the last modification time of FILE
23
24 -R, --rfc-2822
25 output date and time in RFC 2822 format. Example: Mon, 07 Aug
26 2006 12:34:56 -0600
27
28 --rfc-3339=TIMESPEC
29 output date and time in RFC 3339 format. TIMESPEC=`date', `sec‐
30 onds', or `ns' for date and time to the indicated precision.
31 Date and time components are separated by a single space:
32 2006-08-07 12:34:56-06:00
33
34 -s, --set=STRING
35 set time described by STRING
36
37 -u, --utc, --universal
38 print or set Coordinated Universal Time
39
40 --help display this help and exit
41
42 --version
43 output version information and exit
44
45 FORMAT controls the output. The only valid option for the second form
46 specifies Coordinated Universal Time. Interpreted sequences are:
47
48 %% a literal %
49
50 %a locale's abbreviated weekday name (e.g., Sun)
51
52 %A locale's full weekday name (e.g., Sunday)
53
54 %b locale's abbreviated month name (e.g., Jan)
55
56 %B locale's full month name (e.g., January)
57
58 %c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)
59
60 %C century; like %Y, except omit last two digits (e.g., 21)
61
62 %d day of month (e.g, 01)
63
64 %D date; same as %m/%d/%y
65
66 %e day of month, space padded; same as %_d
67
68 %F full date; same as %Y-%m-%d
69
70 %g last two digits of year of ISO week number (see %G)
71
72 %G year of ISO week number (see %V); normally useful only with %V
73
74 %h same as %b
75
76 %H hour (00..23)
77
78 %I hour (01..12)
79
80 %j day of year (001..366)
81
82 %k hour ( 0..23)
83
84 %l hour ( 1..12)
85
86 %m month (01..12)
87
88 %M minute (00..59)
89
90 %n a newline
91
92 %N nanoseconds (000000000..999999999)
93
94 %p locale's equivalent of either AM or PM; blank if not known
95
96 %P like %p, but lower case
97
98 %r locale's 12-hour clock time (e.g., 11:11:04 PM)
99
100 %R 24-hour hour and minute; same as %H:%M
101
102 %s seconds since 1970-01-01 00:00:00 UTC
103
104 %S second (00..60)
105
106 %t a tab
107
108 %T time; same as %H:%M:%S
109
110 %u day of week (1..7); 1 is Monday
111
112 %U week number of year, with Sunday as first day of week (00..53)
113
114 %V ISO week number, with Monday as first day of week (01..53)
115
116 %w day of week (0..6); 0 is Sunday
117
118 %W week number of year, with Monday as first day of week (00..53)
119
120 %x locale's date representation (e.g., 12/31/99)
121
122 %X locale's time representation (e.g., 23:13:48)
123
124 %y last two digits of year (00..99)
125
126 %Y year
127
128 %z +hhmm numeric timezone (e.g., -0400)
129
130 %:z +hh:mm numeric timezone (e.g., -04:00)
131
132 %::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
133
134 %:::z numeric time zone with : to necessary precision (e.g., -04,
135 +05:30)
136
137 %Z alphabetic time zone abbreviation (e.g., EDT)
138
139 By default, date pads numeric fields with zeroes. The following
140 optional flags may follow `%':
141
142 - (hyphen) do not pad the field
143
144 _ (underscore) pad with spaces
145
146 0 (zero) pad with zeros
147
148 ^ use upper case if possible
149
150 # use opposite case if possible
151
152 After any flags comes an optional field width, as a decimal number;
153 then an optional modifier, which is either E to use the locale's alter‐
154 nate representations if available, or O to use the locale's alternate
155 numeric symbols if available.
156
158 TZ Specifies the timezone, unless overridden by command line param‐
159 eters. If neither is specified, the setting from /etc/localtime
160 is used.
161
163 Written by David MacKenzie.
164
166 Report bugs to <bug-coreutils@gnu.org>.
167
169 Copyright © 2007 Free Software Foundation, Inc.
170 This is free software. You may redistribute copies of it under the
171 terms of the GNU General Public License
172 <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the
173 extent permitted by law.
174
176 The full documentation for date is maintained as a Texinfo manual. If
177 the info and date programs are properly installed at your site, the
178 command
179
180 info date
181
182 should give you access to the complete manual.
183
184
185
186GNU coreutils 6.9 March 2007 DATE(1)