当前位置: 技术问答>linux和unix
在shell中我要怎么取得其一天的时间?(在线等待)
来源: 互联网 发布时间:2015-07-11
本文导语: 在shell中,用date可以得到当前的时间,请问我怎么得到前一天的时间呢? | * To print the date of the day before yesterday: date --date='2 days ago' * To print the date of the day ...
在shell中,用date可以得到当前的时间,请问我怎么得到前一天的时间呢?
|
* 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
* To print the current full month name and the day of the month:
date '+%B %d'
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
* To print the current full month name and the day of the month:
date '+%B %d'