{"id":27144,"date":"2019-11-01T15:11:37","date_gmt":"2019-11-01T19:11:37","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=27144"},"modified":"2019-11-02T14:51:42","modified_gmt":"2019-11-02T18:51:42","slug":"the-varying-date-distantfuture","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/11\/01\/the-varying-date-distantfuture\/","title":{"rendered":"The Varying Date.distantFuture"},"content":{"rendered":"<p><a href=\"https:\/\/developer.apple.com\/documentation\/foundation\/nsdate\/1415385-distantfuture\">Apple<\/a>:<\/p>\n<blockquote cite=\"https:\/\/developer.apple.com\/documentation\/foundation\/nsdate\/1415385-distantfuture\">\n<p>An <code>NSDate<\/code> object representing a date in the distant future (in terms of centuries).<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/chockenberry\/status\/1189978361998667776\">Craig Hockenberry<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/chockenberry\/status\/1189978361998667776\"><p><code>Date.distantFuture<\/code> is fixed at &ldquo;January 1, 4001 at 12:00:00 AM GMT&rdquo; - that means its <code>timeIntervalSince1970<\/code> (currently at 64,092,211,200) will change over time because of leap seconds.<\/p><p>Date\/time will always be hard, unless the Earth stops moving.<\/p><\/blockquote>\n\n<p>In other words, even within the same run (not to mention when unarchiving), you can&rsquo;t rely on two distant future dates being equal. So don&rsquo;t use it as a sentinel value.<\/p>\n\n<p><a href=\"https:\/\/twitter.com\/nikopolator\/status\/1190010668075892740\">Nikolai Ruhe<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/nikopolator\/status\/1190010668075892740\">\n<p>I think <code>timeIntervalSinceReferenceDate<\/code>  (and <code>1970<\/code>) works differently: It does not take leap seconds into account. Each day ends at an exact multiple of 86400. That means that a given <code>timeInterval<\/code> might point to one (normal), two or zero points in time (at leap seconds).<\/p>\n<\/blockquote>\n\n<p id=\"the-varying-date-distantfuture-update-2019-11-02\">Update (2019-11-02): The value can also vary <a href=\"https:\/\/twitter.com\/lapcatsoftware\/status\/1190349270353883137\">between OS releases<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Apple: An NSDate object representing a date in the distant future (in terms of centuries). Craig Hockenberry: Date.distantFuture is fixed at &ldquo;January 1, 4001 at 12:00:00 AM GMT&rdquo; - that means its timeIntervalSince1970 (currently at 64,092,211,200) will change over time because of leap seconds.Date\/time will always be hard, unless the Earth stops moving. In other [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2019-11-01T19:11:41Z","apple_news_api_id":"92b77381-ed2e-4ec0-b40f-c09847bb426f","apple_news_api_modified_at":"2019-11-02T18:51:46Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/Akrdzge0uTsC0D8CYR7tCbw","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,31,1667,30,1666,71,364],"class_list":["post-27144","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios","tag-ios-13","tag-mac","tag-macos-10-15","tag-programming","tag-time"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27144","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=27144"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27144\/revisions"}],"predecessor-version":[{"id":27153,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27144\/revisions\/27153"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=27144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=27144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=27144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}