Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
No datetime solution in Clear category for Days Between by DiZ
def days_diff(date1, date2):
def days(date):
y, m, d = date
days = 365 * (y-1) + 30 * (m-1) + d
days += ((m + (m+1) // 8) // 2) - 2 # months of 31 days
days += y//4 - y//100 + y//400 # lap years
if m < 3: days += 2 - (not y%4 and (y%100>0 or not y%400)) # January-February
return days
return abs(days(date1) - days(date2))
Oct. 29, 2015
Comments: