TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

My experience with JavaScript's Date and the missing year 0

2 点作者 AlexTelon超过 8 年前

1 comment

DrScump超过 8 年前
TL;DR : GIGO - Garbage In, Garbage Out.<p>(For reference: I worked on my company&#x27;s ANSI Datetime implementation over 20 years ago, and the ANSI spec made it clear: using an invalid date (like A.D. 0) or an expression that yields an invalid date (e.g. &quot;3&#x2F;31&#x2F;2017&quot; - 1 UNITS MONTH) must always return an <i>error</i> and never just return wrong or garbage data.