use chrono::{self, TimeZone, Utc};
fn main() {
let a = Utc.ymd(1940, 1, 0);
let b = Utc.ymd(1940, 3, 0);
println!("February in 1940 was {:?} days long.", (b - a).num_days());
}
However the code above panics at runtime saying thread 'main' panicked at 'No such local time'.
use chrono::{self, TimeZone, Utc};
fn main() {
let a = Utc.ymd(1940, 1, 1);
let b = Utc.ymd(1940, 3, 1);
println!("February in 1940 was {:?} days long.", (b - a).num_days());
}