Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. def daysBetweenDates(year1, month1, day1, year2, month2, day2):
  2. monthsCommonYear = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
  3. monthsLeapYear = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
  4. daysCount = day2
  5.  
  6. if checkLeapYear(year1): # days in first month
  7. daysCount += monthsLeapYear[month1 - 1] - day1
  8. else:
  9. daysCount += monthsCommonYear[month1 - 1] - day1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement