Skip to content

duration loses microsecond precision on large values #332

Description

@sir-sigurd
In [18]: from pendulum import duration

In [19]: duration(microseconds=8999999999999999).microseconds
Out[19]: 999998

but

In [20]: from datetime import timedelta

In [21]: timedelta(microseconds=8999999999999999).microseconds
Out[21]: 999999

It's caused by using total_seconds() which loses microseconds precision.

IMHO there is no need to provide microseconds property since it's already provided by parent class.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions