You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
louischan-oursky
changed the title
[Serialization] Date serialization should never affected by environment
[Serialization] Date serialization should never be affected by environment
Sep 4, 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.
The text was updated successfully, but these errors were encountered: