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

RFC3339 Parser is wrong #40

Closed
crystalin opened this issue Apr 6, 2018 · 2 comments
Closed

RFC3339 Parser is wrong #40

crystalin opened this issue Apr 6, 2018 · 2 comments

Comments

@crystalin
Copy link

crystalin commented Apr 6, 2018

Hi sir,

When looking at your code, I notice that your RFC3339 Parser (https://github.com/julman99/gson-fire/blob/master/src/main/java/io/gsonfire/util/RFC3339DateFormat.java#L93) is considering the fraction of a second as milliseconds, which is incorrect according to the RFC3339 specs.

It should be a fraction of a second, made of 1 or more digits
see (https://tools.ietf.org/html/rfc3339#section-5.6)

this would be a valid rfc3339: 2017-01-01T01:01:01.123456789Z

Alan

@julman99
Copy link
Owner

julman99 commented Apr 7, 2018

That is correct, but the Date class in Java can't have more precision than milliseconds. The question would be if 2017-01-01T01:01:01.123999999Z should interpreted as 2017-01-01T01:01:01.123Z or 2017-01-01T01:01:01.124Z

@crystalin
Copy link
Author

crystalin commented Apr 7, 2018 via email

@julman99 julman99 closed this as completed Apr 7, 2018
@julman99 julman99 reopened this Apr 8, 2018
julman99 added a commit that referenced this issue Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants