I'm having trouble doing this in a clean and simple way in python.
What I'd like to do is having a piece of code that calculates the number of days passed between 2 dates. For example today being the 22nd of december and i want to know how many days i have before the 15th of febuary. There are 55 days difference
(i took this example because it englobes 2 different years an multiple months)
What i made was very messy and dosen't work half the time so i'm kind of embarrassed to show it.
Any help is appreciated.
Thanks in advance
Simpler implementation:
import datetime
d1 = datetime.datetime(2013,12,22)
d2 = datetime.datetime(2014,2,15)
(d2-d1).days
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments