ASi

epoc ミリ秒/unixtime 日付文字列 変換

epoc milli seconds <-> date string transform

milli sec -> date string

ruby -e 'puts Time.at(1514764800, 000000).getutc'
2018-01-01 00:00:00 UTC


node -p 'new Date(1514764800000)'
2018-01-01T00:00:00.000Z

date string -> milli sec

ruby -e 't=Time.new(2018,01,01,00,00,00,"+00:00"); puts t.to_i*1000 + t.nsec*1000'
1514764800000


node -p 'new Date("2018-01-01 00:00:00Z").getTime()'
1514764800000