1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Linux(bash)dateコマンドチートシート

Last updated at Posted at 2021-08-31

dateコマンドに関するチートシート

やりたいこと・フォーマット コマンド
yyyy-mm-dd date "+%Y-%m-%d"
yyyy-mm-dd HH:MM:SS date "+%Y-%m-%d %H:%M:%S"
yyyy-mm-dd HH:MM:SS+ナノ秒 date "+%Y-%m-%d %H:%M:%S.%N"
30日後 date "+%Y-%m-%d" -d "30 days"
30日前 date "+%Y-%m-%d" -d "30 days ago"
特定日の30日後 date "+%Y-%m-%d" -d "30 days 2021-02-28"
特定日の30日前 date "+%Y-%m-%d" -d "30 days ago 2021-02-28"
UNIX時間 date "+%s"
UNIX時間を日付に date "+%Y-%m-%d %H:%M:%S" -d "@1630378862"
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?