| 569 | return year, month, day |
| 570 | |
| 571 | def _check_time_fields(hour, minute, second, microsecond, fold): |
| 572 | hour = _index(hour) |
| 573 | minute = _index(minute) |
| 574 | second = _index(second) |
| 575 | microsecond = _index(microsecond) |
| 576 | if not 0 <= hour <= 23: |
| 577 | raise ValueError(f"hour must be in 0..23, not {hour}") |
| 578 | if not 0 <= minute <= 59: |
| 579 | raise ValueError(f"minute must be in 0..59, not {minute}") |
| 580 | if not 0 <= second <= 59: |
| 581 | raise ValueError(f"second must be in 0..59, not {second}") |
| 582 | if not 0 <= microsecond <= 999999: |
| 583 | raise ValueError(f"microsecond must be in 0..999999, not {microsecond}") |
| 584 | if fold not in (0, 1): |
| 585 | raise ValueError(f"fold must be either 0 or 1, not {fold}") |
| 586 | return hour, minute, second, microsecond, fold |
| 587 | |
| 588 | def _check_tzinfo_arg(tz): |
| 589 | if tz is not None and not isinstance(tz, tzinfo): |