-
Notifications
You must be signed in to change notification settings - Fork 554
Open
Labels
bugSomething isn't workingSomething isn't working
Description
问题描述
对于java.time.Instant对象(其他时间类没有测试过),在配置完全相同的情况下,fastjson2在v2.0.40和v2.0.61版本中序列化结果不一致。
配置:
- json配置:config.setSerializerFeatures(SerializerFeature.UseISO8601DateFormat)
- spring启动配置:TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
v2.0.40中,Instant对象被序列化成:"2026-02-24T14:50:00Z"(正确)
v2.0.61中,Instant对象被序列化成:"2026-02-24 14:50:00" (错误)
环境信息
请填写以下信息:
- OS信息: Ubuntu 22; Windows 11
- JDK信息:JDK 11
- 版本信息:fastjson2 2.0.61
重现步骤
如何操作可以重现该问题:
见上文
期待的正确结果
对您期望发生的结果进行清晰简洁的描述。
对于已经设置UTC时区的情况,java.time.Instant应该被序列化为YYYY-MM-DDThh:mm:ss的格式。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working