Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Serialization] Date serialization should never be affected by environment #128

Open
louischan-oursky opened this issue Sep 4, 2017 · 1 comment

Comments

@louischan-oursky
Copy link

louischan-oursky commented 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.

@louischan-oursky 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
@louischan-oursky
Copy link
Author

We may also need to check our other client side SDK implementations to see if they suffer this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants