Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def daysBetweenDates(year1, month1, day1, year2, month2, day2):
- monthsCommonYear = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
- monthsLeapYear = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
- daysCount = day2
- if checkLeapYear(year1): # days in first month
- daysCount += monthsLeapYear[month1 - 1] - day1
- else:
- daysCount += monthsCommonYear[month1 - 1] - day1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement