date sets the current date and time (with appropriate privilege), lists the current date or file dates, or converts dates.
Most common date forms are recognized, including those for
crontab(1), ls(1),
touch(1), and the default output from date itself.
If the date operand consists of 4, 6, 8, 10 or 12 digits followed by an optional . and two digits then it is
interpreted as: HHMM.SS, ddHHMM.SS, mmddHHMM.SS, mmddHHMMyy.SS or yymmddHHMM.SS, or mmddHHMMccyy.SS
or ccyymmddHHMM.SS. Conflicting standards and practice allow a leading or trailing 2 or 4 digit year for the 10 and 12
digit forms; the X/Open trailing form is used to disambiguate (touch(1) uses
the leading form.) Avoid the 10 digit form to avoid confusion. The digit fields are:
- cc
- Century - 1, 19-20.
- yy
- Year in century, 00-99.
- mm
- Month, 01-12.
- dd
- Day of month, 01-31.
- HH
- Hour, 00-23.
- MM
- Minute, 00-59.
- SS
- Seconds, 00-60.
If more than one
date operand is specified then:
- 1.
- Each operand sets the reference date for the next operand.
- 2.
- The date is listed for each operand.
- 3.
- The system date is not set.