0
0

More than 3 years have passed since last update.

UNIX時間について調べた【編集中】

Last updated at Posted at 2020-04-17

【背景】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タイムスタンプを取得する方法

0
0
2

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