3 ms·
In .NET there is an AddYears function that deals with all of this, and even gives you Feb 29 if the date is valid, otherwise Feb 28: https://learn.microsoft.com
by ryanjshaw 3y ago
In .NET there is an AddYears function that deals with all of this, and even gives you Feb 29 if the date is valid, otherwise Feb 28: https://learn.microsoft.com/en-us/dotnet/api/system.datetime.addyears?view=net-8.0 https://learn.microsoft.com/en-us/dotnet/api/system.datetime...
- willsmith72 3y agoThere's the same in python, but if you wanna write shitty code you can always get around it
- linehedonist 3y agoYup relativedelta https://dateutil.readthedocs.io/en/stable/relativedelta.html https://dateutil.readthedocs.io/en/stable/relativedelta.html
- wwilim 3y agoIs it just me or does .NET have the most sane standard library for dealing with dates? Until you get into timezones that is