1 DATE(1) General Commands Manual DATE(1)
4 date - show and set date and time
7 date [ -u ] [ -c ] [ -r seconds ] [ +format ] [ [yyyy]mmddhhmm[yy][.ss]
11 Date without arguments writes the date and time to the standard output
13 Wed Mar 8 14:54:40 EST 1989
14 with EST replaced by the local time zone's abbreviation (or by the
15 abbreviation for the time zone specified in the TZ environment variable
16 if set). The exact output format depends on the locale.
18 If a command-line argument starts with a plus sign ("+"), the rest of
19 the argument is used as a format that controls what appears in the
20 output. In the format, when a percent sign ("%" appears, it and the
21 character after it are not output, but rather identify part of the date
22 or time to be output in a particular way (or identify a special
25 Sample output Explanation
26 %a Wed Abbreviated weekday name*
27 %A Wednesday Full weekday name*
28 %b Mar Abbreviated month name*
29 %B March Full month name*
30 %c Wed Mar 08 14:54:40 1989 Date and time*
32 %d 08 Day of month (always two digits)
33 %D 03/08/89 Month/day/year (eight characters)
34 %e 8 Day of month (leading zero blanked)
35 %h Mar Abbreviated month name*
36 %H 14 24-hour-clock hour (two digits)
37 %I 02 12-hour-clock hour (two digits)
38 %j 067 Julian day number (three digits)
39 %k 2 12-hour-clock hour (leading zero blanked)
40 %l 14 24-hour-clock hour (leading zero blanked)
41 %m 03 Month number (two digits)
42 %M 54 Minute (two digits)
43 %n \n newline character
44 %p PM AM/PM designation
45 %r 02:54:40 PM Hour:minute:second AM/PM designation
47 %S 40 Second (two digits)
49 %T 14:54:40 Hour:minute:second
50 %U 10 Sunday-based week number (two digits)
51 %w 3 Day number (one digit, Sunday is 0)
52 %W 10 Monday-based week number (two digits)
55 %y 89 Last two digits of year
57 %z -0500 Numeric time zone
58 %Z EST Time zone abbreviation
59 %+ Wed Mar 8 14:54:40 EST 1989 Default output format*
60 * The exact output depends on the locale.
62 If a character other than one of those shown above appears after a
63 percent sign in the format, that following character is output. All
64 other characters in the format are copied unchanged to the output; a
65 newline character is always added at the end of the output.
67 In Sunday-based week numbering, the first Sunday of the year begins
68 week 1; days preceding it are part of "week 0". In Monday-based week
69 numbering, the first Monday of the year begins week 1.
71 To set the date, use a command line argument with one of the following
73 1454 24-hour-clock hours (first two digits) and minutes
74 081454 Month day (first two digits), hours, and minutes
75 03081454 Month (two digits, January is 01), month day, hours, minutes
76 8903081454 Year, month, month day, hours, minutes
77 0308145489 Month, month day, hours, minutes, year
78 (on System V-compatible systems)
79 030814541989 Month, month day, hours, minutes, four-digit year
80 198903081454 Four-digit year, month, month day, hours, minutes
81 If the century, year, month, or month day is not given, the current
82 value is used. Any of the above forms may be followed by a period and
83 two digits that give the seconds part of the new time; if no seconds
84 are given, zero is assumed.
86 These options are available:
89 Use Universal Time when setting and showing the date and time.
92 Output the date that corresponds to seconds past the epoch of
93 1970-01-01 00:00:00 UTC, where seconds should be an integer,
94 either decimal, octal (leading 0), or hexadecimal (leading 0x),
95 preceded by an optional sign.
98 /usr/lib/locale/L/LC_TIME description of time locale L
99 /usr/local/etc/zoneinfo time zone information directory
100 /usr/local/etc/zoneinfo/localtime local time zone file
101 /usr/local/etc/zoneinfo/posixrules used with POSIX-style TZ's
102 /usr/local/etc/zoneinfo/GMT for UTC leap seconds
104 If /usr/local/etc/zoneinfo/GMT is absent, UTC leap seconds are loaded
105 from /usr/local/etc/zoneinfo/posixrules.