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]LocalDateTime 反序列化问题 #1620

Closed
zacat opened this issue Jul 6, 2023 · 2 comments
Closed

[BUG]LocalDateTime 反序列化问题 #1620

zacat opened this issue Jul 6, 2023 · 2 comments
Labels
bug Something isn't working fixed
Milestone

Comments

@zacat
Copy link

zacat commented Jul 6, 2023

问题描述

从前端传回的日期带有时区,在Fastjson反序列,能不能加一个配置,处理一下这个问题?

环境信息

请填写以下信息:

  • OS信息: [e.g.:CentOS 8.4.2105 4Core 3.10GHz 16 GB]
  • JDK信息: [e.g.:Openjdk 1.8.0_312]
  • 版本信息:[e.g.:Fastjson2 2.x.x]

java.time.format.DateTimeParseException: Text '2023-07-02T16:00:00.000Z' could not be parsed at index 10
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2052) ~[?:?]
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1954) ~[?:?]
at java.time.LocalDateTime.parse(LocalDateTime.java:494) ~[?:?]
at com.alibaba.fastjson2.JSONReader.readLocalDate(JSONReader.java:904) ~[fastjson2-2.0.34.jar:?]
at com.alibaba.fastjson2.JSONReaderUTF8.readLocalDate(JSONReaderUTF8.java:5298) ~[fastjson2-2.0.34.jar:?]
at com.alibaba.fastjson2.reader.ORG_1_16_EmpDTO.readObject(Unknown Source) ~[?:?]
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1476) ~[fastjson2-2.0.34.jar:?]
at com.alibaba.fastjson2.support.spring6.http.converter.FastJsonHttpMessageConverter.readType(FastJsonHttpMessageConverter.java:111) ~[fastjson2-extension-spring6-2.0.34.jar:?]
at com.alibaba.fastjson2.support.spring6.http.converter.FastJsonHttpMessageConverter.read(FastJsonHttpMessageConverter.java:80) ~[fastjson2-extension-spring6-2.0.34.jar:?]

@zacat zacat added the bug Something isn't working label Jul 6, 2023
@wenshao wenshao added this to the 2.0.35 milestone Jul 6, 2023
@wenshao
Copy link
Member

wenshao commented Jul 7, 2023

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

@wenshao wenshao added the fixed label Jul 8, 2023
@wenshao
Copy link
Member

wenshao commented Jul 9, 2023

https://github.com/alibaba/fastjson2/releases/tag/2.0.35
问题已修复,请用新版本

@wenshao wenshao closed this as completed Jul 9, 2023
wenshao added a commit that referenced this issue Nov 5, 2023
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