LoginSignup
10
10

More than 5 years have passed since last update.

【覚書】unix timestamp -> date に変換するワンライナーいろいろ

Posted at
php -r 'date_default_timezone_set("Asia/Tokyo"); echo date("Y-m-d H:i:s", 1416236400) . "\n";'
python -c "import datetime; print datetime.datetime.fromtimestamp(1416236400)"
ruby -e 'print(Time.at(1416236400), "\n")'
node -p "new Date(1416236400 * 1000)"
date -r 1416236400

最後のやつを最初に調べるべきだったわ。

10
10
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
10
10