我想根据用户的时区将UTC ISO 8601日期字符串转换为用户的本地日期时间.我使用Moment-TimeZone来完成这项任务,下面是代码片段:
const userTimezone = moment.tz.guess();
const time = moment.utc("2023-03-08T16:35:21.453")
.tz(userTimezone)
.format("MM/DD/YYYY h:mm A")
Does Moment Timezone consider the DST rules of the selected time zone and apply the appropriate DST offset to the formatted time?个
如果我的日期字符串在DST范围内,那么它会在格式化时自动调整DST偏移量,还是我们必须手动调整DST偏移量?