Emmanuil 73a9f0ffcf 20.07.2020 | 4 years ago | |
---|---|---|
.. | ||
builds | 4 years ago | |
data | 4 years ago | |
.npmignore | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
changelog.md | 4 years ago | |
composer.json | 4 years ago | |
index.d.ts | 4 years ago | |
index.js | 4 years ago | |
moment-timezone-utils.d.ts | 4 years ago | |
moment-timezone-utils.js | 4 years ago | |
moment-timezone.js | 4 years ago | |
package-lock.json | 4 years ago | |
package.json | 4 years ago |
IANA Time Zone Database + Moment.js.
var june = moment("2014-06-01T12:00:00Z");
june.tz('America/Los_Angeles').format('ha z'); // 5am PDT
june.tz('America/New_York').format('ha z'); // 8am EDT
june.tz('Asia/Tokyo').format('ha z'); // 9pm JST
june.tz('Australia/Sydney').format('ha z'); // 10pm EST
var dec = moment("2014-12-01T12:00:00Z");
dec.tz('America/Los_Angeles').format('ha z'); // 4am PST
dec.tz('America/New_York').format('ha z'); // 7am EST
dec.tz('Asia/Tokyo').format('ha z'); // 9pm JST
dec.tz('Australia/Sydney').format('ha z'); // 11pm EST