Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Duration to Represent Time in Months/Years #1587

Open
codeslubber opened this issue Jun 6, 2024 · 1 comment
Open

Need Duration to Represent Time in Months/Years #1587

codeslubber opened this issue Jun 6, 2024 · 1 comment

Comments

@codeslubber
Copy link

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.

@djc
Copy link
Contributor

djc commented Jun 7, 2024

https://docs.rs/chrono/latest/chrono/struct.DateTime.html#method.checked_add_months?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants