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
解析没有”“的date时,fastjson-2.0.50返回一个错误的时间,fastjson2-2.0.50和fastjson-1.2.83抛出异常。建议兼容包抛出适当异常,避免返回错误的值。
import com.alibaba.fastjson2.JSON; import org.junit.jupiter.api.Test; import java.util.Date; import static org.junit.jupiter.api.Assertions.assertEquals; public class Issue1276_10 { @Test public void test() { Date sendTime = JSON.parseObject("2023-03-24 11:10:00", Date.class); System.out.println(sendTime); } @Test public void test2_fj() { Date sendTime2 = com.alibaba.fastjson.JSON.parseObject("2023-03-24 11:10:00", Date.class); System.out.println(sendTime2); } @Test public void test3() { Date sendTime1 = JSON.parseObject("\"2023-03-24 11:10:00\"", Date.class); Date sendTime2 = com.alibaba.fastjson.JSON.parseObject("\"2023-03-24 11:10:00\"", Date.class); assertEquals(sendTime1, sendTime2); } }
// fastjson 2.0.50 Thu Jan 01 08:00:02 CST 1970
The text was updated successfully, but these errors were encountered:
fix JSON.parseObject with unquote date, for issue alibaba#2598
cd2a0f5
fix JSON.parseObject with unquote date, for issue #2598
b2f9ca4
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
问题描述
解析没有”“的date时,fastjson-2.0.50返回一个错误的时间,fastjson2-2.0.50和fastjson-1.2.83抛出异常。建议兼容包抛出适当异常,避免返回错误的值。
环境信息
重现步骤
相关日志输出
// fastjson 2.0.50
Thu Jan 01 08:00:02 CST 1970
The text was updated successfully, but these errors were encountered: