{"id":42314,"date":"2024-03-01T14:19:37","date_gmt":"2024-03-01T19:19:37","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=42314"},"modified":"2024-03-01T14:20:49","modified_gmt":"2024-03-01T19:20:49","slug":"leap-year-bugs","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2024\/03\/01\/leap-year-bugs\/","title":{"rendered":"Leap Year Bugs"},"content":{"rendered":"<p><a href=\"https:\/\/old.mermaid.town\/@futzle\/112011940311873173\">Deborah Pickett<\/a>:<\/p>\n<blockquote cite=\"https:\/\/old.mermaid.town\/@futzle\/112011940311873173\">\n<p>Kazakhstan, which has not observed daylight saving for 20 years, is turning the clocks back at 0:00 on 1 March 2024, to 23:00 on leap day February 29 2024.<\/p>\n<p>Definitely playing time zones on Hard Mode, Kazakhstan. Thanks for doing some QA on stacked edge cases for us all!<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/mastodon.social\/@gregtitus@social.coop\/112012474598057061\">Greg Titus<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mastodon.social\/@gregtitus@social.coop\/112012474598057061\"><p>OH SURE, let&rsquo;s do a daylight savings change right at midnight  on a leap day. AND combine two time zone regions into one at the same time.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/mastodon.social\/@RebeccaSlatkin\/112015826823754148\">Rebecca Sloane<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mastodon.social\/@RebeccaSlatkin\/112015826823754148\"><p>today is the day that separates the haves read the calendar \/ date documentation from  the have-nots read the docs but my custom logic works so I&rsquo;m shipping it<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/techhub.social\/@sjs\/112015771689316177\">Sami Samhuri<\/a>:<\/p>\n<blockquote cite=\"https:\/\/techhub.social\/@sjs\/112015771689316177\">\n<p>It&rsquo;s a great day to check your date math for bugs. Foundation&rsquo;s calendar is forgiving and you might not want that. Using <code>DateComponents<\/code> to ask for 29-02-2023 will give you 01-03-2023.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/rachelbythebay.com\/w\/2024\/02\/29\/tib\/\">Rachel Kroll<\/a>:<\/p>\n<blockquote cite=\"https:\/\/rachelbythebay.com\/w\/2024\/02\/29\/tib\/\"><p>Only half of the fun of a leap year happens on February 29th.<\/p><p>The rest of it happens in ten months, when a bunch more code finds out that it&rsquo;s somehow day 366, and promptly flips out. Thus, instead of preparing to party, those people get to spend the day finding out why their device is being stupid all of the sudden.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/arstechnica.com\/gadgets\/2024\/02\/leap-year-glitch-broke-self-pay-pumps-across-new-zealand-for-over-10-hours\/\">Scharon Harding<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=39553755\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/arstechnica.com\/gadgets\/2024\/02\/leap-year-glitch-broke-self-pay-pumps-across-new-zealand-for-over-10-hours\/\"><p>As reported by numerous international outlets, self-serve pumps in New Zealand were unable to accept card payments due to a problem with the gas pumps&rsquo; payment processing software.<\/p><\/blockquote>\n\n<p>See also: <a href=\"https:\/\/news.ycombinator.com\/item?id=39554539\">Did you encounter any leap year bugs today?<\/a>.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2024\/03\/01\/time-1-0-0-swift-package\/\">Time 1.0.0 Swift Package<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2015\/07\/31\/falsehoods-programmers-believe\/\">Falsehoods Programmers Believe<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Deborah Pickett: Kazakhstan, which has not observed daylight saving for 20 years, is turning the clocks back at 0:00 on 1 March 2024, to 23:00 on leap day February 29 2024. Definitely playing time zones on Hard Mode, Kazakhstan. Thanks for doing some QA on stacked edge cases for us all! Greg Titus: OH SURE, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2024-03-01T19:19:40Z","apple_news_api_id":"765de98f-4e20-4012-bb5c-2f341392aeba","apple_news_api_modified_at":"2024-03-01T19:20:51Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/Adl3pj04gQBK7XC80E5Kuug","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,71,364],"class_list":["post-42314","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-programming","tag-time"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/42314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=42314"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/42314\/revisions"}],"predecessor-version":[{"id":42319,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/42314\/revisions\/42319"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=42314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=42314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=42314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}