| 526 | return year, month, day |
| 527 | |
| 528 | def _check_time_fields(hour, minute, second, microsecond, fold): |
| 529 | hour = _index(hour) |
| 530 | minute = _index(minute) |
| 531 | second = _index(second) |
| 532 | microsecond = _index(microsecond) |
| 533 | if not 0 <= hour <= 23: |
| 534 | raise ValueError('hour must be in 0..23', hour) |
| 535 | if not 0 <= minute <= 59: |
| 536 | raise ValueError('minute must be in 0..59', minute) |
| 537 | if not 0 <= second <= 59: |
| 538 | raise ValueError('second must be in 0..59', second) |
| 539 | if not 0 <= microsecond <= 999999: |
| 540 | raise ValueError('microsecond must be in 0..999999', microsecond) |
| 541 | if fold not in (0, 1): |
| 542 | raise ValueError('fold must be either 0 or 1', fold) |
| 543 | return hour, minute, second, microsecond, fold |
| 544 | |
| 545 | def _check_tzinfo_arg(tz): |
| 546 | if tz is not None and not isinstance(tz, tzinfo): |