Anonymous user
Days between dates: Difference between revisions
some inline explanations
mNo edit summary |
(some inline explanations) |
||
Line 8:
https://stackoverflow.com/questions/12862226/the-implementation-of-calculating-the-number-of-days-between-2-dates
This example is
Line 22:
def days( y,m,d ):
'''
m = (m + 9) % 12
y = y - m/10
''' with (m*306 + 5)/10 the number of days from march 1 to the current 'm' month '''
result = 365*y + y/4 - y/100 + y/400 + (m*306 + 5)/10 + ( d - 1 )
return result
|