date -d参数可以根据当前日期获取更多我们需要的日期。
例如
1、本月和下月
this_ym=`date +%Y%m`
next_ym=`date -d '1month' +%Y%m`
2、昨天和明天
date -d yesterday
date -d tomorrow
date +%Y%m%d -d "+1 day"
date +%Y%m%d -d'+1 day'
date +%Y%m%d --date "+1 day"
date +%Y%m%d --date='+1 day'
3、指定月份
date -d 1May
现在:
date -d now

相关文章:

  • 2022-01-24
  • 2022-01-26
  • 2021-11-02
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2021-11-18
  • 2021-09-25
相关资源
相似解决方案