Converting Gregorian dates to day numbers
From Tech
Jump to navigationJump to searchdef calcday(y, m, d): """ Return days since 2000-01-01 y: year m: month (1=jan) d: day (1=first day of month) """ #return m*30 + (m+(m>7))//2+d - (m>2)*(2-(y%4==0))+365*y+(y-1)//4 - 730530 return m*30 + 14*m//25+d - (m>2)*(2-(y%4==0))+365*y+(y-1)//4 - 730530