javascript - 2012-2020年的矩数据是什么意思?

标签 javascript momentjs

我想在我的 js 文件中使用 moment.js 从一个时区转换为另一个时区。我想知道下面的文字是什么意思?

For convenience, there are builds available on momentjs.com/timezone/ with all the zone data or a subset of the data with support for only 2012-2022.

https://momentjs.com/timezone/docs/

这是否意味着 moment.js 仅在日期介于 2012-2022 之间时才支持时区之间的转换?

最佳答案

如果您的需求介于这些年份之间,请使用“2010-2020”文件,它轻巧且速度更快。

现在回答你的问题:

Does that mean moment.js supports conversion between timezones only if the date lies between 2012- 2022 ?

答案是 2012- 2022文件包含 2012-2022 之间的数据。但这并不意味着main file不包含 2012-2022 年的数据。该文件也包含数据,但比 moment-timezone-with-data-2012-2022.js

解释:

这两个不同文件的原因是 moment-timezone 的数据不包含同比规则,而是包含给定年份范围内的特定转换。

在运行时进行更快的查找,但代价是必须决定要使用的数据子集。

“所有年份”文件包含过去所有已知的过渡,以及大约 20 年的 future 过渡。 “2010-2020”文件仅包含近期和近期。

关于javascript - 2012-2020年的矩数据是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50109908/

相关文章:

javascript - 按 ID 识别行,然后按类别识别其中一个单元格

javascript - Knockout.JS 绑定(bind)处理程序 moment.js

javascript - 使用 momentjs 获取前几年的数组

javascript - 使用带矩的 Handlebars 模板

javascript - 冒泡 componentWillUpdate 和 componentDidUpdate

javascript - jQuery/Isotope 复杂的 AND/OR 过滤

javascript - 如何将 112889 (mmddyy) 转换为 11/28/89 或 11/28/1989

javascript - 有没有一种方法可以用时刻检索日期格式?

javascript - 单击 div 时如何播放简单的声音片段(如按钮单击)

javascript - 遍历 Javascript 对象搜索键值