Skip to content

Add direct to timedelta conversion #4

@2br-2b

Description

@2br-2b

Right now, if you enter 1 month, then convert it into a timedelta as such:

datetime.timedelta(seconds=parse('1 month'))

Then, if you add that timedelta to a datetime, the value will be incorrect in certain months, as per the readme:

For months and years, the library does not consider complications such as leap- years and leap-seconds. Instead, it assumes "30 days for a month" and "365 days for a year" as the basis for calculations with those units.

It would be helpful to have a convert to timedelta option to handle stuff like this.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions