【发布时间】:2021-10-27 15:26:31
【问题描述】:
所以当我们使用moment-timezone 配置默认时区时,我们会这样做:
moment.tz.setDefault('America/Sao_Paulo')
我正在寻找一种从 moment.tz 对象中检索该值 (America/Sao_Paulo) 的方法...我无法在他们的 documentation page 上找到它:/ 我假设它会是类似的东西给moment.tz.getCurrent() // America/Sao_Paulo
顺便说一句,这与moment.tz.guess() 不同,因为我不想要用户的本地时区,我想要的是当前配置的时区,无论浏览器的时区如何。
【问题讨论】:
标签: javascript momentjs moment-timezone