Same date in different time zone

前端 未结 4 2113
小鲜肉
小鲜肉 2020-12-02 17:18

My question is how can I get the same day, month, year, hour, minutes, seconds in a different time zone, for example:

var now = moment().valueOf();
var resul         


        
4条回答
  •  囚心锁ツ
    2020-12-02 17:56

    From the moment docs: http://momentjs.com/timezone/docs/

    reference moment-timezone-with-data.js and specify which timezone to go to, like so:

    moment(date).tz("America/Los_Angeles").format()
    

提交回复
热议问题