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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

When should you use DateTime and when should you use Time?

85 点作者 aps-sids将近 10 年前

3 条评论

anton_gogolev将近 10 年前
Two obligatory links on what a strange thing &quot;time&quot; is:<p>[1]: <a href="http:&#x2F;&#x2F;infiniteundo.com&#x2F;post&#x2F;25326999628&#x2F;falsehoods-programmers-believe-about-time" rel="nofollow">http:&#x2F;&#x2F;infiniteundo.com&#x2F;post&#x2F;25326999628&#x2F;falsehoods-programm...</a><p>[2]: <a href="http:&#x2F;&#x2F;infiniteundo.com&#x2F;post&#x2F;25509354022&#x2F;more-falsehoods-programmers-believe-about-time" rel="nofollow">http:&#x2F;&#x2F;infiniteundo.com&#x2F;post&#x2F;25509354022&#x2F;more-falsehoods-pro...</a>
colinramsay将近 10 年前
This is superbly well explained with a great example but it doesn&#x27;t quite explain why I wouldn&#x27;t just use DateTime for everything? Or did I miss something?
评论 #9699712 未加载
thwarted将近 10 年前
<i>We can see the actual date of Shakespeare&#x27;s death by using...</i><p>The use of &quot;actual&quot; seems dubious in this context. The whole point of this gist is that time interpretation is relative. I like how the author makes the distinction with &quot;solar years&quot; later on.