-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
使用 ISO8601 序列化日期类型, 结果JSON串中缺少时区段,导致浏览器中获取的时间出错 #301
Comments
这个问题是时区造成的。前端JS只好做兼容: 或者在序列化时直接按照日期字符串转换,而不是拿到long型日期。 |
bug fixed. i will include in 1.2.9 & 1.1.49.android |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
按照https://github.com/alibaba/fastjson/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98 文档中关于日期时间的处理,序列化时通过SerializerFeature.UseISO8601DateFormat 指定序列化配置,应该序列化为"2015-03-02T16:59:11.621+08:00"的数据被序列化为"2015-03-02T16:59:11.621"
缺少时区后缀,在反序列化时会被认为是 UTC 时间.反序列化为 Js 对象后跟原始数据相差8小时.
The text was updated successfully, but these errors were encountered: