首页 > 解决方案 > moment.tz 使用 UTC

问题描述

我很难理解moment.tz,基本上我正在将时间转移到欧洲/苏黎世时间

       moment
          .tz(moment(time), 'Europe/Zurich')
          .format()

而不是这个我想在UTC时间而不是欧洲/苏黎世转换它,我尝试使用

moment
          .utc(time)
          .format()

没有成功,有没有办法像我在第一个考试中那样做?,即:

       moment
          .tz(moment(time), 'UTC')
          .format()

还是会飞得很高?

谢谢你的时间

标签: momentjsmoment-timezone

解决方案


推荐阅读