We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
基于#2460,fastjson和fastjson2序列化timestamp格式不统一
import com.alibaba.fastjson2.JSON; import org.junit.jupiter.api.Test; import java.sql.Timestamp; import java.time.Instant; import static org.junit.jupiter.api.Assertions.assertEquals; public class MutatedIssue2460_351 { @Test public void mutatedTest() { // Create a Timestamp object with different epoch milliseconds Timestamp ts = Timestamp.from(Instant.ofEpochMilli(1713494836124L)); String str1 = JSON.toJSONString(ts); String str2 = com.alibaba.fastjson.JSON.toJSONString(ts); assertEquals(str1, str2); } }
统一数据格式
Expected :"2024-04-19 10:47:16.124" Actual :1713494836124
The text was updated successfully, but these errors were encountered:
fastjson1和fastjson2在这个的行为不一致设计就是这样的,这不是bug
Sorry, something went wrong.
No branches or pull requests
问题描述
基于#2460,fastjson和fastjson2序列化timestamp格式不统一
环境信息
重现步骤
期待的正确结果
统一数据格式
相关日志输出
Expected :"2024-04-19 10:47:16.124"
Actual :1713494836124
The text was updated successfully, but these errors were encountered: