LoginSignup
13
10

More than 5 years have passed since last update.

moment.jsのtimezoneを1行で日本に設定。

Posted at
var moment = require('moment-timezone');
moment.tz.setDefault("Asia/Tokyo");
console.log( moment().format() ); // 日本の現在時刻になっていることが確認できる。

公式サイトの情報はこちら。
http://momentjs.com/timezone/docs/#/using-timezones/default-timezone/

13
10
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
13
10