Construct a datetime from a given date and a given time.
(cls, date, time, tzinfo=True)
| 1903 | |
| 1904 | @classmethod |
| 1905 | def combine(cls, date, time, tzinfo=True): |
| 1906 | "Construct a datetime from a given date and a given time." |
| 1907 | if not isinstance(date, _date_class): |
| 1908 | raise TypeError("date argument must be a date instance") |
| 1909 | if not isinstance(time, _time_class): |
| 1910 | raise TypeError("time argument must be a time instance") |
| 1911 | if tzinfo is True: |
| 1912 | tzinfo = time.tzinfo |
| 1913 | return cls(date.year, date.month, date.day, |
| 1914 | time.hour, time.minute, time.second, time.microsecond, |
| 1915 | tzinfo, fold=time.fold) |
| 1916 | |
| 1917 | @classmethod |
| 1918 | def fromisoformat(cls, date_string): |