LoginSignup
0
0

More than 3 years have passed since last update.

shell の時間処理

Posted at

いつも調べるので、ここでメモ

文字列 ⇒ Date
以下全部いけし、妥当性チェックもやってくれる:

date -d '20121212 7 days'
date -d '12-DEC-2012 7 days'
date -d '2012-12-12 7 days'
date -d '2012-12-12 4:10:10PM 7 days'
date -d '2012-12-12 16:10:55 7 days'

Date ⇒ 文字列

date '+%Y%m%d'

これで足りると思う
参考:https://stackoverflow.com/questions/11144408/convert-string-to-date-in-bash/11144983

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0