Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我发现 Safari (5.1.7 (6534.57.2)) 有一个奇怪的问题,在将日期转换为字符串时,我得到一个毫秒数为负数的表示。
new Date(1966,6,7,20,45,38,713)
结果.toJSON()是:
.toJSON()
"1966-07-07T18:45:38.-287Z"
它是一个 Safari 错误(如我所愿)还是有任何奇怪的 Javascript 规则,这是预期的(甚至是可接受的)行为?
toJSONwebkit 错误跟踪器中的算法存在一个错误:
toJSON
它看起来像另一个测试用例,但它也可能是这个问题的根本原因。