How do I change the year in a DateTime<FixedOffset>
instance (from the rust crate chrono
)?
That is, create a new instance of DateTime<FixedOffset>
that copies the month and day from the old instance.
In other words, how would I complete the following code:
fn datetime_set_year(
datetime: &DateTime<FixedOffset>,
year: &i32
) -> DateTime<FixedOffset>
The code can ignore exceptional cases like leap days (if that is possible).