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

Possible typo in the documentation (leap seconds) #1174

Closed
kamadorueda opened this issue Jul 6, 2023 · 4 comments
Closed

Possible typo in the documentation (leap seconds) #1174

kamadorueda opened this issue Jul 6, 2023 · 4 comments

Comments

@kamadorueda
Copy link
Contributor

The current documentation (https://docs.rs/chrono/0.4.26/chrono/naive/struct.NaiveTime.html#date-and-time-arithmetics) lists the following examples for the handling of leap seconds:

Time + Duration (short for [NaiveTime::overflowing_add_signed](https://docs.rs/chrono/0.4.26/chrono/naive/struct.NaiveTime.html#method.overflowing_add_signed)):

03:00:00 + 1s = 03:00:01.
03:00:59 + 60s = 03:02:00.
03:00:59 + 1s = 03:01:00.
03:00:60 + 1s = 03:01:00. Note that the sum is identical to the previous.
03:00:60 + 60s = 03:01:59.
03:00:60 + 61s = 03:02:00.
03:00:60.1 + 0.8s = 03:00:60.9.

All examples make sense, except 03:00:59 + 60s = 03:02:00. which, given that no operand is a leap second, should be 03:01:59, and in fact, that's what's reported in the playground:

image

Happy to follow up with a PR if this is a true positive

@pitdicker
Copy link
Collaborator

I agree, that doesn't make sense. Looking forward to a PR 👍

@kamadorueda
Copy link
Contributor Author

Oh, wait, I just noticed it's been:

What would be the best course of action?

@pitdicker
Copy link
Collaborator

Haha, I didn't even notice #1146. Then it will make it to main soon in #1169.

@kamadorueda
Copy link
Contributor Author

Cool, I'll close it then! Thank you

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