If a device is configured to use Japanese calendar (or any other non-Gregorian calender) instead of Gregorian calendar. Date serialization gives surprising result.
"2017-09-04T00:00:00.0000Z" gives a NSDate with year 4005 (2017 + 2017 - 29) (since Heisei 29 is Gregorian 2017)
If a device is configured to use Japanese calendar (or any other non-Gregorian calender) instead of Gregorian calendar. Date serialization gives surprising result.
"2017-09-04T00:00:00.0000Z"
gives a NSDate with year 4005 (2017 + 2017 - 29) (since Heisei 29 is Gregorian 2017)This problem is mentioned in https://stackoverflow.com/questions/39562517/dateformatter-changes-date-by-500-years and the answer contains a proper fix by configuring NSDateFormatter to a predictable timezone and locale rather relying on the environment.