Construct a datetime from a given date and a given time.
(cls, date, time, tzinfo=True)
| 1808 | |
| 1809 | @classmethod |
| 1810 | def combine(cls, date, time, tzinfo=True): |
| 1811 | "Construct a datetime from a given date and a given time." |
| 1812 | if not isinstance(date, _date_class): |
| 1813 | raise TypeError("date argument must be a date instance") |
| 1814 | if not isinstance(time, _time_class): |
| 1815 | raise TypeError("time argument must be a time instance") |
| 1816 | if tzinfo is True: |
| 1817 | tzinfo = time.tzinfo |
| 1818 | return cls(date.year, date.month, date.day, |
| 1819 | time.hour, time.minute, time.second, time.microsecond, |
| 1820 | tzinfo, fold=time.fold) |
| 1821 | |
| 1822 | @classmethod |
| 1823 | def fromisoformat(cls, date_string): |