-
-
Notifications
You must be signed in to change notification settings - Fork 387
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
Period: months/years not counted in total_seconds()
#387
Comments
#389 |
@senpos that is not related to this issue, but I could help with an answer :) |
Any update? This bug can bite users if they're not careful. |
Here's a quick way to reproduce this:
The output should contain months and years. |
Closed
2 tasks
I think this issue can be closed, it was fixed by PR #482. |
Confirmed resolved with pendulum==3.0.0 and Python==3.11.4:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pendulum version: 2.0.5, possibly related to #346
Context
When working with classes/functions/APIs that expect some period be passed as number of seconds, I like to use a Duration + the
total_seconds()
function to clearly express what kind of period I'm passing.Problem
I'm running into a situation where I want a period of a year in total seconds, but to my surprise I get 0 as a result. While experimenting I found that the same applies for months. Weeks and smaller seem to work as expected.
Examples
The text was updated successfully, but these errors were encountered: