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] 2022-02-16T16:00:00.000Z illegal date input #1325

Closed
lorna1 opened this issue Apr 6, 2023 · 2 comments
Closed

[BUG] 2022-02-16T16:00:00.000Z illegal date input #1325

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

Comments

@lorna1
Copy link

lorna1 commented Apr 6, 2023

问题描述

日期格式:2022-02-16T16:00:00.000Z 序列化报错 illegal date input

环境信息

请填写以下信息:

  • OS信息: [e.g.:MacOs 13.2]
  • JDK信息: [e.g.:jdk 1.8.0_212]
  • 版本信息:[e.g.:Fastjson2 2.0.24]

重现步骤

字段 private Date activeDate;
json {"activeDate": "2022-02-16T16:00:00.000Z"}

Exception in thread "main" com.alibaba.fastjson2.JSONException: illegal date input, offset 16, character ", line 1, column 17, fastjson-version 2.0.24 {"activeDate": "2022-02-16T16:00:00.000Z"}
at com.alibaba.fastjson2.JSONReaderUTF16.readMillis19(JSONReaderUTF16.java:6801)
at com.alibaba.fastjson2.reader.ObjectReaderImplDate.readDate(ObjectReaderImplDate.java:99)
at com.alibaba.fastjson2.reader.ObjectReaderImplDate.readObject(ObjectReaderImplDate.java:70)

期待的正确结果

正确序列化

@lorna1 lorna1 added the bug Something isn't working label Apr 6, 2023
wenshao added a commit that referenced this issue Apr 7, 2023
wenshao added a commit that referenced this issue Apr 7, 2023
@wenshao
Copy link
Member

wenshao commented Apr 8, 2023

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

@wenshao wenshao closed this as completed Apr 8, 2023
@wenshao wenshao added this to the 2.0.28 milestone Apr 8, 2023
@wenshao wenshao added the fixed label Apr 8, 2023
@wenshao
Copy link
Member

wenshao commented Apr 15, 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