Display users local zone abbreviation

后端 未结 5 1931
耶瑟儿~
耶瑟儿~ 2020-12-17 10:17

I was trying to use z or zz in format to display the timezone at the end of the string and found that it\'s deprecated. Z and ZZ

5条回答
  •  粉色の甜心
    2020-12-17 11:00

    After searching a lot, this seems to work.

    const t = moment.tz.guess();
    timeZone = moment.tz(t).zoneAbbr();;
    

提交回复
热议问题