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
{{ message }}
This repository was archived by the owner on Oct 23, 2024. It is now read-only.
我们发现在使用fastjson(包括最版版本的fastjson)的方法: JSON.toJSONString(date, SerializerFeature.UseISO8601DateFormat) 做Date->String的转换时没有考虑夏令时, 所以会导致在洛杉矶时区中在夏令时期间做此转换会不符合业务预期.
(1)fastjson获取毫秒偏移的方法为:calendar.getTimeZone().getRawOffset(),而getRawOffset()是不考虑夏令时。
(2)javax中的原生方法获取毫秒偏移方法为:calendar.getTimeZone().getOffset(long date),getOffset(long date)方法会考虑夏令时。
具体可以见之前转的邮件"fastjson夏令时期间Date转换导致时区错误问题分析"