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
fastjson 1.2.22版本 Jdk8DateCodec.java
LocalDateTime dateTime = (LocalDateTime) object; if (dateTime.getNano() == 0) { String format = serializer.getDateFormatPattern(); if (format == null) { format = JSON.DEFFAULT_DATE_FORMAT; } write(out, dateTime, format); } else { out.writeString(object.toString()); }
看 这里是 dateTime.getNano() == 0 才会进行format处理,LocalDateTime.now()产生的时间,都是不成立的,所以在toString时,即使是这样设置,都不会生效: @OverRide public String toString() { return JSON.toJSONStringWithDateFormat(this,"yyyy-MM-dd HH:mm:ss:SSS", SerializerFeature.DisableCircularReferenceDetect); }
按理纳秒都要能处理啊。
The text was updated successfully, but these errors were encountered:
1.2.23已经修复问题,将会尽快发布新版本
Sorry, something went wrong.
No branches or pull requests
fastjson 1.2.22版本
Jdk8DateCodec.java
LocalDateTime dateTime = (LocalDateTime) object;
if (dateTime.getNano() == 0) {
String format = serializer.getDateFormatPattern();
if (format == null) {
format = JSON.DEFFAULT_DATE_FORMAT;
}
write(out, dateTime, format);
} else {
out.writeString(object.toString());
}
看 这里是 dateTime.getNano() == 0 才会进行format处理,LocalDateTime.now()产生的时间,都是不成立的,所以在toString时,即使是这样设置,都不会生效:
@OverRide
public String toString() {
return JSON.toJSONStringWithDateFormat(this,"yyyy-MM-dd HH:mm:ss:SSS",
SerializerFeature.DisableCircularReferenceDetect);
}
按理纳秒都要能处理啊。
The text was updated successfully, but these errors were encountered: