fastjson2 icon indicating copy to clipboard operation
fastjson2 copied to clipboard

[BUG] java.sql.Timestamp序列化问题

Open changeAtLater opened this issue 1 year ago • 1 comments

问题描述

Timestamp timestamp1 = Timestamp.from(Instant.ofEpochMilli(1713494836000L));
System.out.println(JSON.toJSONString(timestamp1));
Timestamp timestamp2 = Timestamp.from(Instant.ofEpochMilli(1713494836123L));
System.out.println(JSON.toJSONString(timestamp2));

结果:

1713494836000
"2024-04-19 10:47:16.123"

环境信息

请填写以下信息:

  • OS信息: [e.g.:win10]
  • JDK信息: [e.g.:jdk 1.8.0_231]
  • 版本信息:[e.g.:Fastjson2 2.0.49]

期待的正确结果

请统一数据样式!!!

changeAtLater avatar Apr 19 '24 02:04 changeAtLater

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.50-SNAPSHOT/ 问题已修复,请帮忙用2.0.50-SNAPSHOT版本验证

wenshao avatar Apr 19 '24 17:04 wenshao

https://github.com/alibaba/fastjson2/releases/tag/2.0.50 2.0.50已发布,请用新版本

wenshao avatar May 12 '24 05:05 wenshao