-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
StdDateFormat: accept and truncate millis larger than 3 digits #1745
Comments
I would be open to patch for this. Initially I was concerned about possible confusion between rounding and truncation; but if truncation is the usual default we should go with that. |
Need a PR or do you handle it yourself ? |
@brenuart I can handle it eventually but PR would speed things up (sometimes I fix things quickly, other times take longer hard to know). If you want to do PR that'd be great -- I think this is for |
I know how hard it is to maintain such an OSS project ;-) BTW, why do you say "this is for |
@brenuart What I meant is that 2.9 has rewritten version, so earlier branches would need separate patch (no objections to that, just bit more work -- and not sure how many releases of 2.8.x will be made). |
Now allowing up to 9 digits -- can change, or even remove limit, but I think there's some benefit to sanity checking. But if there is some legit usage to, say, 12 or 15, let me know. |
Java8 is likely to produce datetimes with nanosecond precision: the millis part may therefore be larger than 3 digits.
Unfortunately, Jackson's StdDateFormat fails to parse datetimes when the so-called millis have more than 3 digits - hence breaking interoperability between systems build upon these two technologies.
Although the standard
java.util.Date
supports only millis precision, JodaTime accepts datetimes serialized with nano-precision and truncate it to the first three digits. I think it would be nice if the StdDateFormat does the same...The text was updated successfully, but these errors were encountered: