1 | .TH DATE 1
|
---|
2 | .SH NAME
|
---|
3 | date \- print or set the date and time
|
---|
4 | .SH SYNOPSIS
|
---|
5 | \fBdate [\fB\-qsuS\fR] [\fB\-r\fI seconds\fR]
|
---|
6 | [[\fIMMDDYY\fR]\fIhhmm\fR[\fIss\fR]] [\fI+format\fR]\fR
|
---|
7 | .br
|
---|
8 | .de FL
|
---|
9 | .TP
|
---|
10 | \\fB\\$1\\fR
|
---|
11 | \\$2
|
---|
12 | ..
|
---|
13 | .de EX
|
---|
14 | .TP 20
|
---|
15 | \\fB\\$1\\fR
|
---|
16 | # \\$2
|
---|
17 | ..
|
---|
18 | .SH OPTIONS
|
---|
19 | .FL "\-q" "Read the date from \fIstdin\fR"
|
---|
20 | .FL "\-s" "Set the time (implicit for \fB\-q\fR or a date string)"
|
---|
21 | .FL "\-u" "Print the date as GMT"
|
---|
22 | .FL "\-S" "Date within Eternal September"
|
---|
23 | .FL "\-r" "Use this number of seconds instead of current time"
|
---|
24 | .SH EXAMPLES
|
---|
25 | .EX "date" "Print the date and time"
|
---|
26 | .EX "date 0221921610" "Set date to Feb 21, 1992 at 4:10 p.m."
|
---|
27 | .SH DESCRIPTION
|
---|
28 | .PP
|
---|
29 | With the \fB\-q\fR flag or a numeric argument,
|
---|
30 | .I date
|
---|
31 | sets the GMT time and date.
|
---|
32 | .I MMDDYY
|
---|
33 | refers to the month, day, and year;
|
---|
34 | .I hhmmss
|
---|
35 | refers to the hour, minute and second.
|
---|
36 | Each of the six fields must be exactly two digits, no more and no less.
|
---|
37 | .I date
|
---|
38 | always display the date and time, with the default format for the system.
|
---|
39 | The \fB\-u\fR flag request GMT time instead of local time.
|
---|
40 | A format may be specified with a + followed by a printf-like string with
|
---|
41 | the following options:
|
---|
42 | .ta 0.25i
|
---|
43 | .nf
|
---|
44 | .PP
|
---|
45 | %% % character
|
---|
46 | %A Name of the day
|
---|
47 | %B Name of the month
|
---|
48 | %D mm/dd/yy
|
---|
49 | %H Decimal hour on 2 digits
|
---|
50 | %I Decimal hour modulo 12 on 2 digits
|
---|
51 | %M Decimal minute on 2 digits
|
---|
52 | %S Decimal seconds on 2 digits
|
---|
53 | %T HH:MM:SS
|
---|
54 | %U Decimal week number, Sunday being first day of week
|
---|
55 | %W Decimal week number, Monday being first day of week
|
---|
56 | %X Same as %T
|
---|
57 | %Y Decimal year on 4 digits
|
---|
58 | %Z Time Zone (if any)
|
---|
59 | %a Abbreviated name of the day
|
---|
60 | %b Abbreviated name of the month
|
---|
61 | %c Appropriate date & time (default format)
|
---|
62 | %d Decimal day of the month on 2 digits
|
---|
63 | %e Same as %d, but a space replaces leading 0
|
---|
64 | %h Same as %b
|
---|
65 | %j Decimal dey of the year on 3 digits
|
---|
66 | %m Decimal month on 2 digits
|
---|
67 | %n Newline character
|
---|
68 | %p AM or PM
|
---|
69 | %r 12-hour clock time with AM/PM
|
---|
70 | %s Number of seconds since the epoch
|
---|
71 | %t Tab character
|
---|
72 | %w Decimal day of the week (0=Sunday)
|
---|
73 | %x Same as %D
|
---|
74 | %y Decimal year on 2 digits
|
---|
75 | .SH "SEE ALSO"
|
---|
76 | .BR time (2),
|
---|
77 | .BR ctime (3),
|
---|
78 | .BR readclock (8).
|
---|