year, month, day -> ordinal, considering 01-Jan-0001 as day 1.
(year, month, day)
| 61 | return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year)) |
| 62 | |
| 63 | def _ymd2ord(year, month, day): |
| 64 | "year, month, day -> ordinal, considering 01-Jan-0001 as day 1." |
| 65 | assert 1 <= month <= 12, 'month must be in 1..12' |
| 66 | dim = _days_in_month(year, month) |
| 67 | assert 1 <= day <= dim, ('day must be in 1..%d' % dim) |
| 68 | return (_days_before_year(year) + |
| 69 | _days_before_month(year, month) + |
| 70 | day) |
| 71 | |
| 72 | _DI400Y = _days_before_year(401) # number of days in 400 years |
| 73 | _DI100Y = _days_before_year(101) # " " " " 100 " |
no test coverage detected