code: def _ymd2ord(year, month, day):
      "year, month, day -> ordinal, considering 01-Jan-0001 as day 1."
      assert 1 <= month <= 12, 'month must be in 1..12'
      dim = _days_in_month(year, month)
      assert 1 <= day <= dim, ('day must be in 1..%d' % dim)
      return (_days_before_year(year) +
              _days_before_month(year, month) +
              dayf _ymd2ord(year, month, day):
      "year, month, day -> ordinal, considering 01-Jan-0001 as day 1."
      assert 1 <= month <= 12, 'month must be in 1..12'
      dim = _days_in_month(year, month)
      assert 1 <= day <= dim, ('day must be in 1..%d' % dim)
      return (_days_before_year(year) +
              _days_before_month(year, month) +
              day)
docs: year, month, day -> ordinal, considering 01-Jan-0001 as day 1.