program to count how many hours we have to get coming newyear
from datetime import datetime
date1 = '7/8/2021'
date2 = '30/12/2021'
startDate = datetime.strptime(date1, "%d/%m/%Y")
endDate = datetime.strptime(date2, "%d/%m/%Y")
diff = endDate.date() - startDate.date()
print('Time in hours between two dates:')
print((diff.days) * 24)
Comments
Leave a comment