Thursday 25 February 2021

How to calculate number of days between two given dates?

 Days until Christmas:

>>> import datetime
>>> today = datetime.date.today()
>>> someday = datetime.date(2008, 12, 25)
>>> diff = someday - today
>>> diff.days
86


from : https://stackoverflow.com/questions/151199/how-to-calculate-number-of-days-between-two-given-dates

No comments:

Post a Comment