【背景】SHOWROOMは日時にUNIX時間を使用している。Javascritpで対応するWebアプリの日時データの型を検討するたみに調査実施
Webアプリでは日時は。。。
UNIX時間は『「協定世界時の」1970年1月1日0時0分0秒からの累計秒』
GMT、UTC、UnixTimeって何が違うの?
JavascritpでUNIX時間に変換すのは下記で
Math.floor(Date.now() / 1000);
// Dateオブジェクトを作成
var date = new Date() ;
// UNIXタイムスタンプを取得する (ミリ秒単位)
var a = date.getTime() ;
// UNIXタイムスタンプを取得する (秒単位 - PHPのtime()と同じ)
var b = Math.floor( a / 1000 ) ;
※@vf8974さんに教えて頂きました。こちらが断然すっきりします
※下記から引用
UNIXタイムスタンプを取得する方法