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

Make ISO serializers for LocalTime/LocalDateTime more predictable #384

Closed
wants to merge 1 commit into from

Conversation

dkhalanskyjb
Copy link
Collaborator

Now, they will always include seconds and will not add trailing zeros for prettiness to the fractional part.

Fixes #351

Now, they will always include seconds and will not add trailing
zeros for prettiness to the fractional part.

Fixes #351
@dkhalanskyjb dkhalanskyjb requested a review from ilya-g April 17, 2024 15:08
@ilya-g
Copy link
Member

ilya-g commented Apr 19, 2024

IMO, this does not solve consistency problem, so we should first discuss it.

@dkhalanskyjb
Copy link
Collaborator Author

Thanks, this was a good call! After an internal discussion, we determined that in general, this wouldn't help a lot to interface with our serializers, given that fractional parts are still optional. For example, in Python, this would lead to code like this anyway: https://stackoverflow.com/questions/30584364/python-strptime-format-with-optional-bits A better way to address this concern seems to be to provide custom serializers and remove the ISO-8601 serializers altogether. We could still provide toString()/parse()-powered ones by some other name.

@dkhalanskyjb dkhalanskyjb deleted the use-iso-format-in-serializers branch April 24, 2024 14:38
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

Successfully merging this pull request may close these issues.

Fix the ISO serializers omitting seconds when zero and emitting fractional parts in groups of three signs
2 participants