Last active
February 7, 2018 21:52
-
-
Save gabrielbissey/2a946869c3957417e85d086265fb771c to your computer and use it in GitHub Desktop.
Calculates number of days between input dates *DOES NOT ACCOUNT FOR LEAP DAYS YET*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def number_of_days(year, month, day): | |
count = 0 | |
count += (year * 360) | |
count += (month * 30) | |
count += day | |
return count | |
def days_between_dates(year1, month1, day1, year2, month2, day2): | |
date1 = number_of_days(year1, month1, day1) | |
date2 = number_of_days(year2, month2, day2) | |
return date2 - date1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment