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

java.util.date Java 11 vs Java 8 different serialization #1719

Open
col-panic opened this issue Jun 10, 2020 · 6 comments
Open

java.util.date Java 11 vs Java 8 different serialization #1719

col-panic opened this issue Jun 10, 2020 · 6 comments
Labels

Comments

@col-panic
Copy link

col-panic commented Jun 10, 2020

I don't know what to make of this, whether its a bug or not - but I think its worth mentioning. If you serialize a java.util.Date object, this is what you get with gson 2.8.0

Java 8 {"creationDate":"Jun 10, 2020 11:13:39 AM"}
Java 11 {"creationDate":"Jun 10, 2020, 11:14:17 AM"}

see the extra , after the year? Java 11 serialized java.util.Date is not deserializable in Java 8.

@Marcono1234
Copy link
Collaborator

Java 11 serialized java.util.Date is not deserializable in Java 11.

You probably meant "Java 8", right? The date format change comes from the JDK, see #1210.
It appears #1682 already describes the incompability issues you are describing here.

@Marcono1234 Marcono1234 added the bug label Aug 5, 2022
@creeper0167
Copy link

Is this still open?...Can I work on this?

@MaicolAntali
Copy link
Contributor

Probably it's related to the CLDR version included in the JDK.
Here you can find some information: Link.

@Jarvan-Song
Copy link

has been fixed ?

@Marcono1234
Copy link
Collaborator

@Jarvan-Song, not as far as I know. In general it might be good to avoid the default Gson date format though and choose a stable and machine readable one, see also this Stack Overflow question.

@Jarvan-Song
Copy link

@Jarvan-Song, not as far as I know. In general it might be good to avoid the default Gson date format though and choose a stable and machine readable one, see also this Stack Overflow question.

thanks

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

5 participants