snippetrustMajor
How do I add days to a Chrono UTC?
Viewed 0 times
dayshowutcaddchrono
Problem
I am trying to find the preferred way to add days to a Chrono
UTC. I want to add 137 days to the current time: let dt = UTC::now();Solution
Just use
Test on playground.
Duration and appropriate operator:use chrono::{Duration, Utc};
fn main() {
let dt = Utc::now() + Duration::days(137);
println!("today date + 137 days {}", dt);
}
Test on playground.
Context
Stack Overflow Q#44710877, score: 99
Revisions (0)
No revisions yet.