Date change issue when deserialization by java 8
Open
bug
- Dominant language
- Java
- Stars
- 24.2k
- Forks
- 4.5k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 12
Description
This is for the same reason outlined on #1210. #1221 fixed part of the issue. The exception happens when the date is serialized with java after 9 and deserialized with java 8.
A quick fix would be add function to create format for java 8:
public static DateFormat getUSDateTimeFormatAfter9(int dateStyle, int timeStyle) {
String pattern = getDatePartOfDateTimePattern(dateStyle) + ", " + getTimePartOfDateTimePattern(timeStyle); // this format is missing from java 8
return new SimpleDateFormat(pattern, Locale.US);
}
Add this to the dateFormats then java version is before 9.
Contributor guide
Assessment
This issue has not been assessed yet.