More than 3 years have passed since last update.
こんなかんじで
new Date(ISO_TIME).getTime() / 1000
確認環境
Node.js のサンプル
ISOtoUNIX.js
'use strict'
let iso = '2017-06-08T02:09:54Z';
console.log('isotime: ' + iso);
let ts = new Date(iso).getTime() / 1000;
console.log('unixts: ' + ts);
実行結果
>node ISOtoUNIX.js.js
isotime: 2017-06-08T02:09:54Z
unixts: 1496887794
Why not register and get more from Qiita?
- We will deliver articles that match you
By following users and tags, you can catch up information on technical fields that you are interested in as a whole
- you can read useful information later efficiently
By "stocking" the articles you like, you can search right away
Sign upLogin