Skip to content
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

[BUG]Fastjson v1兼容模块会将LocalDate、LocalDateTime序列化为时间戳格式 #2477

Closed
johnshawn-david opened this issue Apr 23, 2024 · 1 comment
Labels
bug Something isn't working fixed
Milestone

Comments

@johnshawn-david
Copy link

johnshawn-david commented Apr 23, 2024

问题描述

Fastjson v1兼容模块会将LocalDate、LocalDateTime序列化为时间戳格式

重现步骤

public void jsonTest() {
      Map<String, Object> map = new HashMap<>();
      map.put("startDate", LocalDate.now());
      map.put("endDate", LocalDate.now().plusMonths(1));
      System.out.println(JSON.toJSONString(map));
  }

相关日志输出

{"endDate":1716393600000,"startDate":1713801600000}

@johnshawn-david johnshawn-david added the bug Something isn't working label Apr 23, 2024
FullStackD added a commit to FullStackD/fastjson2 that referenced this issue Apr 28, 2024
@wenshao wenshao modified the milestones: 2.0.51, 2.0.50 May 12, 2024
wenshao added a commit that referenced this issue May 12, 2024
@wenshao
Copy link
Member

wenshao commented May 12, 2024

https://repo1.maven.org/maven2/com/alibaba/fastjson/2.0.50/
问题已修复,请用新版本

@wenshao wenshao added the fixed label May 12, 2024
@wenshao wenshao closed this as completed May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants