LoginSignup
2
2

More than 5 years have passed since last update.

エポックミリ秒取得ワンライナー

Last updated at Posted at 2015-12-01

使うことが多かったので

ミリ秒取得

node.js
node -e 'var hoge = new Date().getTime();console.log(hoge)'
ruby -e "t=Time.now.instance_eval { '%d%03d' % [to_i, (usec / 1000.0).round] };p t"
date +%s%3N

shellのはMacだと動かなかった

ミリ秒から時間へ

echo 1448431010344 | awk '{print strftime("%c", substr($1,0,10))}'

ミリ秒切っちゃってます

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