fastjson
fastjson copied to clipboard
fastjson doesn't parse timestamp wrapped with text format
When Fastjson parses timestamp wrapped with text format, for example, "1570636800000", it doesn't parse this timestamp because the timestamp has quote. If we use replaceAll to remove quote then become 1570636800000, Fastjson is able to parse it. This issue annoys to RequestBody Object to receive JSON from others. Can it be fixed?
Error: FASTJSON parse error Text 1565582400000 to 0
when it comes to LocalDateTime or LocalDate in JDK8
@nikolaslaolao , could you provide the code that doesn't work as expected?
@nikolaslaolao , could you provide the code that doesn't work as expected?
String d={createTime:"1565582400000"}; GetDate date=JSON.parseObject(d, GetDate.class);
Error: FASTJSON parse error Text 1565582400000 to 0
GetDate.class { private LocalDateTime createTime;
set... get... }
@nikolaslaolao , could you provide the code that doesn't work as expected?
@Test public void test(){ String date1="{createTime:"1570636800000"}"; String date2="{createTime:1570636800000}"; LoginRequestDTO dto=JSON.parseObject(date1,LoginRequestDTO.class); } date1 has an error Error: FASTJSON parse error Text 1570636800000 to 0
date2 has no error
It looks like you posted the issue in incorrect project - this fastjson is Go package, while you need fastjson for Java :)