+ 1
Converting integer number of days into date objects in python
So, I'm working on a project and I need to find the difference between two dates and I can do that but I get an integer number of days, can I convert that integer into a date object (e.g. 365 days to 1 year) Also why is the Java course broken for me it constantly crashes the app
2 Réponses
+ 1
Simply assuming 365 days to 1 year might not be the best idea ;-)
I'd stay with the timedelta object that you receive from subtraction of two dates. It plays nicely with leap years: https://code.sololearn.com/cHgU1yf1sseb
+ 1
@Klaus-Dieter Warzecha So In your code the difference is 90/91 days but how do you convert that number into a date