- 论坛徽章:
- 145
|
回复 6# zongg
take a look ...
$ man date
...
DATE STRING
The --date=STRING is a mostly free format human readable date string
such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or
even "next Thursday". A date string may contain items indicating cal‐
endar date, time of day, time zone, day of week, relative time, rela‐
tive date, and numbers. An empty string indicates the beginning of the
day. The date string format is more complex than is easily documented
here but is fully described in the info documentation.
...
$ info date
Note: move to 21.1.7 to see more information
21.1.7 Examples of `date'
-------------------------
Here are a few examples. Also see the documentation for the `-d'
option in the previous section.
* To print the date of the day before yesterday:
date --date='2 days ago'
* To print the date of the day three months and one day hence:
date --date='3 months 1 day'
* To print the day of year of Christmas in the current year:
date --date='25 Dec' +%j
...
|
|