-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
KAFKA-18400: Don't use YYYY when formatting/parsing dates in Java client #18404
KAFKA-18400: Don't use YYYY when formatting/parsing dates in Java client #18404
Conversation
Correcting documented use of YYYY to be yyyy as used by SimpleDateFormat format.
Needs unit tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I understand the distinction between year and week year, and it is certainly the case that the formatting and parsing should be using year (yyyy) and not week-year (YYYY). However, I feel the change of capitalisation of the format examples in the help messages is unhelpful to actual humans. If you want to be really pedantic about the use of SimpleDateFormat, the seconds and milliseconds should be ss.SSS
, not SS.sss
. However, in the help string, it's pretty clear what is meant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are correcting YYYY
to yyyy
, you should also correct SS.sss
to ss.SSS
since "s" is seconds and "S" is milliseconds for SimpleDateFormat
.
The format that is used to parse the user-supplied timestamp is ISO 8601-based. The question is: Should we present to the user the date format in terms of the ISO spec or that of |
I agree. I think what you've done here is appropriate. |
…ent (apache#18404) Reviewers: Andrew Schofield <[email protected]>
Changing documented date format to be ISO 8601 vs.
SimpleDateFormat
.Committer Checklist (excluded from commit message)