Hi.
I am working with dates in Rust but it seems that there isn't a way to compare or make operations between date. Does anyone know how could I work things like: "check if someone is between X and Y age using Date (NaiveDate)"
Thank you for the help!
Code:
fechaaux is a conversion from a tring that gives an "older date" Ex: 1994-01-10
and fechaaux2 is a conversion from todays date.
let fechaaux1 = NaiveDate::parse_from_str(&fecha.to_string(), "%Y-%m-%d");
let fechaaux2 = NaiveDate::parse_from_str(&fechahoy.to_string(), "%Y-%m-%d");
let b = fechaaux2 - fechaaux1; <-- This is were I want to make operations or comparisons
if b<84
{}...