dayjsでtimezone計算
dayjsにはmomentにおけるmoment-timezoneに相当するAPIがない。
const dayjs = require('dayjs') console.log(dayjs(new Date().toLocaleString("en-US", {timeZone: "America/New_York"})).format('h:mA')) console.log(dayjs(new Date().toLocaleString("en-US", {timeZone: "America/Los_Angeles"})).format('h:mA'))
JS組み込みの toLocaleString
を使うのが当面ベターなやり方っぽい。