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
In [9]: pendulum.Duration(years=1).total_seconds()
Out[9]: 0.0
In [10]: pendulum.Duration(months=1).total_seconds()
Out[10]: 0.0
In [11]: pendulum.Duration(days=1).total_seconds()
Out[11]: 86400.0
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