Skip to content
New issue

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

Date change issue when deserialization by java 8 #1682

Open
rsik88 opened this issue Apr 19, 2020 · 1 comment
Open

Date change issue when deserialization by java 8 #1682

rsik88 opened this issue Apr 19, 2020 · 1 comment
Labels

Comments

@rsik88
Copy link

rsik88 commented Apr 19, 2020

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.

@Jarvan-Song
Copy link

has been fixed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants