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? 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
String str1 = ""May 28, 2024 12:10:10 PM""; System.out.println(com.alibaba.fastjson2.JSON.parseObject(str1, Date.class)); String str2 = ""Apr 2, 2024, 2:13:04 PM""; System.out.println(com.alibaba.fastjson2.JSON.parseObject(str2, Date.class));
fastjson对这两种日期格式的反序列化好像都不支持。 第一个是12小时制的中午12点10分的表示方式,fastjson支持解析“May 28, 2024 00:10:10 PM”,无法解析“May 28, 2024 12:10:10 PM”但实际后者才是正确表达方式。 第二个是JDK9以后默认使用CLDR日期格式,与我们之前常用的相比,年份的后面多了个逗号,fastjson能解析“Apr 2, 2024 2:13:04 PM”,但无法解析“Apr 2, 2024, 2:13:04 PM”
The text was updated successfully, but these errors were encountered:
fix deserialize date 12-hour format error, for issue #2635
5809792
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.51-SNAPSHOT/ 问题已修复,请帮忙用2.0.51-SNAPSHOT版本验证
Sorry, something went wrong.
https://github.com/alibaba/fastjson2/releases/tag/2.0.51 请用新版本
No branches or pull requests
String str1 = ""May 28, 2024 12:10:10 PM"";
System.out.println(com.alibaba.fastjson2.JSON.parseObject(str1, Date.class));
String str2 = ""Apr 2, 2024, 2:13:04 PM"";
System.out.println(com.alibaba.fastjson2.JSON.parseObject(str2, Date.class));
fastjson对这两种日期格式的反序列化好像都不支持。
第一个是12小时制的中午12点10分的表示方式,fastjson支持解析“May 28, 2024 00:10:10 PM”,无法解析“May 28, 2024 12:10:10 PM”但实际后者才是正确表达方式。
第二个是JDK9以后默认使用CLDR日期格式,与我们之前常用的相比,年份的后面多了个逗号,fastjson能解析“Apr 2, 2024 2:13:04 PM”,但无法解析“Apr 2, 2024, 2:13:04 PM”
The text was updated successfully, but these errors were encountered: