{"id":51495,"date":"2026-04-07T18:53:27","date_gmt":"2026-04-07T22:53:27","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=51495"},"modified":"2026-04-07T18:53:27","modified_gmt":"2026-04-07T22:53:27","slug":"challenges-with-ancient-dates-in-apple-sdks","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2026\/04\/07\/challenges-with-ancient-dates-in-apple-sdks\/","title":{"rendered":"Challenges With Ancient Dates in Apple SDKs"},"content":{"rendered":"<p><a href=\"https:\/\/casualprogrammer.com\/blog\/2026\/03-27-old-dates-in-apple-sdks.html\">Aaron Trickey<\/a>:<\/p>\n<blockquote cite=\"https:\/\/casualprogrammer.com\/blog\/2026\/03-27-old-dates-in-apple-sdks.html\">\n<p>Foundation&rsquo;s date-handling code has an effective lower bound around January 1, 4713 BC on the Julian calendar. You can create a <code>Date<\/code> value representing an instant in time below that limit, but many <code>Calendar<\/code> methods will return unexpected values when you try to do anything with it.<\/p>\n<p>[&#8230;]<\/p>\n<p>And <code>NSDatePicker<\/code> does okay with BC dates. [&#8230;] <code>UIDatePicker<\/code>, however, simply cuts off at AD 1.<\/p>\n<p>[&#8230;]<\/p>\n<p>When formatting or parsing dates, there is no way to override the built-in era symbols (like &ldquo;BC&rdquo; and &ldquo;AD&rdquo;) or, in locales where multiple conventions are in use, to choose among them.<\/p>\n<p>[&#8230;]<\/p>\n<p>(For going to and from strings, the older <code>DateFormatter<\/code> type does have such a property [for the Julian to Gregorian transition] defined, but it wasn&rsquo;t carried forward into the newer <code>Date.FormatStyle<\/code> API, and it obviously doesn&rsquo;t affect <code>DateComponents<\/code> conversions.)<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2024\/12\/10\/storing-times-for-human-events\/\">Storing Times for Human Events<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2024\/09\/23\/iso8601dateformatter-and-fractional-seconds\/\">ISO8601DateFormatter and Fractional Seconds<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2024\/03\/01\/leap-year-bugs\/\">Leap Year Bugs<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/04\/02\/falsehoods-about-time-and-csvs\/\">Falsehoods About Time and CSVs<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Aaron Trickey: Foundation&rsquo;s date-handling code has an effective lower bound around January 1, 4713 BC on the Julian calendar. You can create a Date value representing an instant in time below that limit, but many Calendar methods will return unexpected values when you try to do anything with it. [&#8230;] And NSDatePicker does okay with [&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":"2026-04-07T22:53:30Z","apple_news_api_id":"71f6b4b8-4ade-443e-8c0a-b00369dae8f8","apple_news_api_modified_at":"2026-04-07T22:53:31Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/Acfa0uEreRD6MCrADadro-A","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,2741,30,2742,71,901,364],"class_list":["post-51495","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios","tag-ios-26","tag-mac","tag-macos-tahoe-26","tag-programming","tag-swift-programming-language","tag-time"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/51495","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=51495"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/51495\/revisions"}],"predecessor-version":[{"id":51496,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/51495\/revisions\/51496"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=51495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=51495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=51495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}