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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

2020 Leap Day Bugs

312 点作者 mj1586大约 5 年前

27 条评论

rachelbythebay大约 5 年前
Let&#x27;s not forget the stuff that&#x27;ll break December 31, 2020... because it&#x27;ll be day 366 (or 365, if 0-indexed).<p>Anyone still using a Zune out there?
评论 #22457017 未加载
评论 #22454483 未加载
hmate9大约 5 年前
This is why no one should ever ever write their own Time or Date library. The number of edge cases is simply enormous
评论 #22452796 未加载
评论 #22455647 未加载
评论 #22452483 未加载
评论 #22453309 未加载
评论 #22452562 未加载
tzs大约 5 年前
Sears appears to have have taken this to a new level. I got two emails from them today. The first arrived at 6:36 AM, with subject<p>&gt; Confirmed! Your mystery Leap Year offer awaits inside. How much will you save?<p>The second arrived at 9:54 AM, with subject<p>&gt; Oops! Your code is fixed. (We shoulda looked before we leap-yeared...)<p>The messages themselves appear to be identical except for some query parameters on some URLs, so I&#x27;m guessing that whatever they botched for leap year was on the server when one tried to respond to the offer.<p>Botching Feb 29 in general date handling code is embarrassing, but there is it least a somewhat plausible excuse that you just forgot about that special case. But botching Feb 29 in code that is meant to only work on Feb 29? Wow.
评论 #22454121 未加载
xxpor大约 5 年前
I haven&#x27;t been able to figure out if this is a Google issue or King County Metro issue yet, but google maps transit directions are completely broken today. Every suggestion is &quot;take Lyft&quot; or wait until 4 am tomorrow.
评论 #22453391 未加载
JensenDied大约 5 年前
I ran into this already on January first. Someone in the last 4 years changed&#x2F;created a function in a MUD that I now maintain, to convert Unix timestamps into iso8601 strings for MySQL.<p>They did the math for which year is a leap year incorrectly, which wasn&#x27;t the bug that bit us, they helpfully added the leap day regardless of where in the year it was. The tests they wrote targeted the middle of the year and missed it. I just pulled in date2j and related match from postgres, added more test cases.
dictum大约 5 年前
Random thought: we&#x27;re now closer to 2038 than to Y2K.
评论 #22453023 未加载
评论 #22452984 未加载
评论 #22452784 未加载
评论 #22452973 未加载
user982大约 5 年前
A line in one of my Python daemons has been crashing it repeatedly all day:<p><pre><code> isotime = datetime.strptime(time.get(&#x27;title&#x27;), &#x27;%a %d %b %I:%M:%S %p&#x27;).replace(year=YEAR, tzinfo=TZ).isoformat() ValueError: day is out of range for month </code></pre> It&#x27;s not mission-critical, so I&#x27;m just going to wait it out until tomorrow.<p>EDIT: Hacked it out.<p><pre><code> isotime = datetime.strptime(f&quot;{time.get(&#x27;title&#x27;)} {YEAR} {tzoffset:+03d}00&quot;, &#x27;%a %d %b %I:%M:%S %p %Y %z&#x27;).isoformat()</code></pre>
评论 #22452593 未加载
评论 #22453212 未加载
评论 #22452639 未加载
btmiller大约 5 年前
LinkedIn has one! Yesterday it listed my time with my current employer as 2 years and 9 months. Today, it’s 2 years and 8 months! Can anyone venture a guess on how I time traveled?
评论 #22456054 未加载
smallstepforman大约 5 年前
So frustrating that my embedded code works without a hitch and our company is nearly bankrupt, while our bank with billions of dollars in annual profit goes offline since it cant handle leap years.
davedunkin大约 5 年前
My bank, IberiaBank, deposited interest and sent out statements today, with them being dated March 1.
ddevault大约 5 年前
Here&#x27;s mine:<p><a href="https:&#x2F;&#x2F;git.sr.ht&#x2F;~sircmpwn&#x2F;meta.sr.ht&#x2F;commit&#x2F;e0be9dcd8e96f952547c243e078c47571f54fca2" rel="nofollow">https:&#x2F;&#x2F;git.sr.ht&#x2F;~sircmpwn&#x2F;meta.sr.ht&#x2F;commit&#x2F;e0be9dcd8e96f9...</a>
评论 #22453621 未加载
评论 #22453567 未加载
andreygrehov大约 5 年前
So happy to see Timehop in this list. I was a little worried about releasing not-a-bug-but-a-feature, but it played out great :)
评论 #22453664 未加载
mercora大约 5 年前
huh! i just noticed few hours ago a pi i use has had the wrong date which was set to a day earlier. I quickly determined a faulty ntp server i had hard configured was giving the bogus time. In case it is of interest its address was &quot;144.76.60.190&quot; and was chosen by random chance because i cant resolve names without working time on that machine (don&#x27;t ask). It appears to be taken offline by now though but i checked its giving the wrong time before changing to another server.<p>Also, but probably unrelated, my WiFi stopped working exactly 00:00AM CET but that might be unrelated as it does that all the time :)
Yessing大约 5 年前
is there something special about 2020 (regarding leap years)?<p>the rule I know is divisible by 4 &amp;&amp; ( not divisible by 100 || divisible by 400) so 2020 is not even an edge case.
评论 #22454505 未加载
评论 #22454441 未加载
评论 #22453898 未加载
评论 #22455395 未加载
ginko大约 5 年前
I&#x27;m kinda surprized that date libraries break with a simple leap year like 2020. I&#x27;d have more understanding if it happened with the year 2000(leap year) or 2100(not a leap year), but the basic &quot;is year divisible by 4&quot; check should be good enough until 2100.
jeromebaek大约 5 年前
relevant: falsehoods programmers believe about time <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4128208" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4128208</a>
imroot大约 5 年前
LogRocket is reporting every date as Feb 28, 2020.
imperialdrive大约 5 年前
The bulk of our deployed Yealink T56 phones displayed February calendar events for the wrong day. I never did find out why.
评论 #22453368 未加载
hipjiveguy大约 5 年前
I deposited a cheque using the ScotiaBank mobile app on March 1, and when I looked at it on my online banking page, it said that it was deposited on March 2!<p>Seems hard to believe that a mobile app would be allowed to tell the server what time the cheque was deposited!
anonsivalley652大约 5 年前
Stupid Q:<p>Why doesn&#x27;t the syslog protocol (RFC5424) deal with leap seconds (the seconds field goes to 00-59, not 00-60)? Are they using UTC (they would have to ignore LS and have crappier logs) or TAI (doesn&#x27;t have LS)?<p><a href="https:&#x2F;&#x2F;mailarchive.ietf.org&#x2F;arch&#x2F;msg&#x2F;syslog&#x2F;DDLgKsRPITFXYSBzicpbqTwtbk8&#x2F;" rel="nofollow">https:&#x2F;&#x2F;mailarchive.ietf.org&#x2F;arch&#x2F;msg&#x2F;syslog&#x2F;DDLgKsRPITFXYSB...</a><p><a href="http:&#x2F;&#x2F;www.madore.org&#x2F;~david&#x2F;computers&#x2F;unix-leap-seconds.html" rel="nofollow">http:&#x2F;&#x2F;www.madore.org&#x2F;~david&#x2F;computers&#x2F;unix-leap-seconds.htm...</a><p><a href="https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc5424" rel="nofollow">https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc5424</a><p><a href="https:&#x2F;&#x2F;cr.yp.to&#x2F;libtai&#x2F;tai64.html" rel="nofollow">https:&#x2F;&#x2F;cr.yp.to&#x2F;libtai&#x2F;tai64.html</a><p><a href="https:&#x2F;&#x2F;cr.yp.to&#x2F;libtai.html" rel="nofollow">https:&#x2F;&#x2F;cr.yp.to&#x2F;libtai.html</a>
评论 #22453923 未加载
评论 #22452770 未加载
geforce大约 5 年前
My car clock went back from 2:00AM to 12:00. I was really wondering what happened.
est31大约 5 年前
Just solve it the Google way: <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;2266&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;2266&#x2F;</a>
xmdx大约 5 年前
I think I found one. My Amex bill is due on the 29th and I have a direct debit to pay it automatically. However it never got taken. First time this has ever happened.<p>Let&#x27;s see if it happens today since it&#x27;s now the 1st.
system2大约 5 年前
Considering billions of devices and services not being affected, these bugs are very insignificant. At least we figured out leap day bugs and not having y2k crisis&#x27; every four years.
tech234a大约 5 年前
My Timex Expedition watch also skipped to March 1.
评论 #22453330 未加载
评论 #22455825 未加载
评论 #22454352 未加载
lamby大约 5 年前
Does anyone remember the fail2ban issue where it used 100% CPU for the entire day?
susam大约 5 年前
I learnt the following test for leap year early in my software engineering career from the book &quot;The C Programming Language&quot; by Kernighan &amp; Ritchie (see section 2.5 Arithmetic Operators):<p><pre><code> (year % 4 == 0 &amp;&amp; year % 100 != 0) || year % 400 == 0 </code></pre> The following test also works:<p><pre><code> year % 4 == 0 &amp;&amp; (year % 100 != 0 || year % 400 == 0)</code></pre>
评论 #22459836 未加载