+ 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

15th Apr 2017, 4:38 PM
Ontleybot
Ontleybot - avatar
2 Respuestas
+ 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
15th Apr 2017, 5:41 PM
Klaus-Dieter Warzecha
Klaus-Dieter Warzecha - avatar
+ 1
@Klaus-Dieter Warzecha So In your code the difference is 90/91 days but how do you convert that number into a date
15th Apr 2017, 6:43 PM
Ontleybot
Ontleybot - avatar