Skip to content

Allow to add and subtract durations from Utc #13

@ChristopherRabotin

Description

@ChristopherRabotin

This should return another Utc. This will be needed to support loops over time, such as:

let mut current = Utc::new(/*...*/);
let end =  Utc::new(/*...*/);
while current < end {
/* do stuff */
    current += std::time::Duration(1, 0) // Or current += 1*SECOND
}

Eventually also include in this PR some short cuts such as:

hifitime::constants::{DAY, HOUR, MINUTE, SECOND, MICROSECOND, NANOSECOND};

Note that these short cut will need to support multiplications with floats and unsigned integers to make it useful. This may require some custom implementation such as hifitime::StdDuration::from_hours() or hifitime::StdDuration::from_seconds(10). I am pretty sure I cannot just use hifitime::Duration since it's re-exported.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions