what is the current best practices for doing date arithmetic in Rust ?
For example, I want to subtract two dates and get the number of days between them?
Here is what I have done and it appears to work but I would like opinions if this is idiomatic Rust and in line with best practices because I am new to Rust. Below I used chrono crate https://docs.rs/chrono/0.4.11/chrono/
let mut dt = Utc.ymd(2014, 7, 1); let mut prev_dt = Utc.ymd(2000, 12, 1); // different in Days is: dt.signed_duration_since(prev_dt).num_days();
Thank you in advance!