LoginSignup
32
26

More than 5 years have passed since last update.

unixtimeと日付の変換

Posted at

日付 から unixtime への変換方法

date コマンドに ‘+%s’ 引数をつけると unixtime で表示する。
特定の日付を変換したいときは、’–date’ オプションで。

$ date +%s
1305730800

unixtime から 日付 への変換方法

$ date --date "@1305730800"
2011年 5月 19日 木曜日 00:00:00 JST

$ echo 1305730800 | awk '{print strftime("%c",$1)}'
2011年05月19日 00時00分00秒
32
26
1

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
32
26