1 |
DATE(1) DATE(1) |
2 |
|
3 |
NAME |
4 |
date - show and set date and time |
5 |
|
6 |
SYNOPSIS |
7 |
date [ -u ] [ -c ] [ -n ] [ -d dsttype ] [ -t minutes-west ] [ -a |
8 |
[+|-]sss.fff ] [ +format ] [ [yyyy]mmddhhmm[yy][.ss] ] |
9 |
|
10 |
DESCRIPTION |
11 |
Date without arguments writes the date and time to the standard output |
12 |
in the form |
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. |
17 |
|
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 |
23 |
character to output): |
24 |
|
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* |
31 |
%C 19 Century |
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 |
46 |
%R 14:54 Hour:minute |
47 |
%S 40 Second (two digits) |
48 |
%t \t tab character |
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) |
53 |
%x 03/08/89 Date* |
54 |
%X 14:54:40 Time* |
55 |
%y 89 Last two digits of year |
56 |
%Y 1989 Year in full |
57 |
%Z EST Time zone abbreviation |
58 |
%+ Wed Mar 8 14:54:40 EST 1989 Default output format* |
59 |
* The exact output depends on the locale. |
60 |
|
61 |
If a character other than one of those shown above appears after a |
62 |
percent sign in the format, that following character is output. All |
63 |
other characters in the format are copied unchanged to the output; a |
64 |
newline character is always added at the end of the output. |
65 |
|
66 |
In Sunday-based week numbering, the first Sunday of the year begins |
67 |
week 1; days preceding it are part of ``week 0.'' In Monday-based week |
68 |
numbering, the first Monday of the year begins week 1. |
69 |
|
70 |
To set the date, use a command line argument with one of the following |
71 |
forms: |
72 |
1454 24-hour-clock hours (first two digits) and minutes |
73 |
081454 Month day (first two digits), hours, and minutes |
74 |
03081454 Month (two digits, January is 01), month day, hours, minutes |
75 |
8903081454 Year, month, month day, hours, minutes |
76 |
0308145489 Month, month day, hours, minutes, year |
77 |
(on System V-compatible systems) |
78 |
030814541989 Month, month day, hours, minutes, four-digit year |
79 |
198903081454 Four-digit year, month, month day, hours, minutes |
80 |
If the century, year, month, or month day is not given, the current |
81 |
value is used. Any of the above forms may be followed by a period and |
82 |
two digits that give the seconds part of the new time; if no seconds |
83 |
are given, zero is assumed. |
84 |
|
85 |
These options are available: |
86 |
|
87 |
-u or -c |
88 |
Use UTC when setting and showing the date and time. |
89 |
|
90 |
-n Do not notify other networked systems of the time change. |
91 |
|
92 |
-d dsttype |
93 |
Set the kernel-stored Daylight Saving Time type to the given |
94 |
value. (The kernel-stored DST type is used mostly by ``old'' |
95 |
binaries.) |
96 |
|
97 |
-t minutes-west |
98 |
Set the kernel-stored ``minutes west of UTC'' value to the one |
99 |
given on the command line. (The kernel-stored DST type is used |
100 |
mostly by ``old'' binaries.) |
101 |
|
102 |
-a adjustment |
103 |
Change the time forward (or backward) by the number of seconds |
104 |
(and fractions thereof) specified in the adjustment argument. |
105 |
Either the seconds part or the fractions part of the argument |
106 |
(but not both) may be omitted. On BSD-based systems, the |
107 |
adjustment is made by changing the rate at which time advances; |
108 |
on System-V-based systems, the adjustment is made by changing |
109 |
the time. |
110 |
|
111 |
FILES |
112 |
/usr/lib/locale/L/LC_TIME description of time locale L |
113 |
/usr/local/etc/zoneinfo time zone information directory |
114 |
/usr/local/etc/zoneinfo/localtime local time zone file |
115 |
/usr/local/etc/zoneinfo/posixrules used with POSIX-style TZ's |
116 |
/usr/local/etc/zoneinfo/GMT for UTC leap seconds |
117 |
|
118 |
If /usr/local/etc/zoneinfo/GMT is absent, UTC leap seconds are loaded |
119 |
from /usr/local/etc/zoneinfo/posixrules. |
120 |
|
121 |
DATE(1) |