chrono
chrono copied to clipboard
Need Duration to represent time in months/years
In reading around it seems that this was left out because years are not the same length nor are months.
The use case I am trying to support is a product that expires, or must be replaced, after 3 years. The precision is of course a non-issue in this use case. I am going to use the lifetime (Duration) to compute the Expiration by adding it to the Installation.
Yes I can just do it by multiplying types that are there.
It does seem that basic use cases should not be unexpressable.
https://docs.rs/chrono/latest/chrono/struct.DateTime.html#method.checked_add_months?
Something like java.time.Period or datetime.timedelta would still be useful. Also (de)serializing RFC 3339/iso 8601 durations
See also jiff::Span.