gpt4 book ai didi

javascript - 这是什么类型的日期格式以及如何将其格式化为人类可读的格式?

转载 作者:行者123 更新时间:2023-11-28 14:15:12 26 4
gpt4 key购买 nike

这是什么类型的日期格式?

+57432-03-28T16:01:10Z

我尝试过使用普通的 Javascript、daysjs 和 moment,但我总是得到“无效日期”。有人遇到过这种情况吗?

此外,我无法在网络上找到以下日期格式。

最佳答案

看起来您处于 57432 年,而我们处于 2019 年。开个玩笑,加个 0 就可以了。

new Date('+057432-03-28T16:01:10Z')

原因是,ECMAScript 需要 6 位数的年份才能支持其年份扩展功能。

此链接对此进行了解释: http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15

编辑(正如@RobG指出的):

此链接包含最新详细信息:http://ecma-international.org/ecma-262/10.0/#sec-expanded-years

关于javascript - 这是什么类型的日期格式以及如何将其格式化为人类可读的格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57800416/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com