LoginSignup
0
0

More than 5 years have passed since last update.

moment.jsが勝手にlocalのtimezoneを拾ってきていたのでメモ

Posted at

moment.jsが勝手にlocalのTimezoneを拾ってきていたのでメモ
(多分docsのどっかに書いてありそう) 

console.log(moment('2017-11-29 11:00')) //1511920800000
console.log(moment('2017-11-29 11:00').tz('Asia/Tokyo')) //1511920800000
console.log(moment('2017-11-29 11:00').tz('Europe/London')) //1511920800000
console.log(moment('2017-11-29 11:00').format('YYYY-MM-DD HH:mm:ss')) //2017-11-29 11:00:00
console.log(moment('2017-11-29 11:00').tz('Asia/Tokyo').format('YYYY-MM-DD HH:mm:ss')) //2017-11-29 11:00:00
console.log(moment('2017-11-29 11:00').tz('Europe/London').format('YYYY-MM-DD HH:mm:ss')) //2017-11-29 02:00:00

大人しくtimestamp突っ込む

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