Closed
Description
Technically speaking the negative duration is not the valid ISO 8601, but we need to print it anyway.
This code:
use std::time::duration::Duration;
fn main() {
let a = Duration::days(1) + Duration::seconds(1);
println!("#1. Should be -{0}, in fact {1}", a, -a);
let b = Duration::nanoseconds(1);
println!("#2. Should be -{0}, in fact {1}", b, -b);
}
Produces:
Should be -P1DT1S
, in fact P-1DT-1S
Should be -PT0.000000001S
, in fact PT-1.999999999S
Metadata
Metadata
Assignees
Labels
No labels