Add duration_since methods to DateTime

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Unknown
    • bson-2.7.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There's currently not an easy way to calculate the time elapsed between two bson::DateTimes without converting to other types. We should implement subtraction methods to do this; we can likely copy checked_sub, saturating_sub, and impl Sub from OffsetDateTime: https://docs.rs/time/latest/time/struct.OffsetDateTime.html#

       

      Edit: a more accurate analogy would be the checked_duration_since and saturating_duration_since methods in std::time::Instant.

              Assignee:
              Isabel Atkinson
              Reporter:
              Isabel Atkinson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: