Return a new time with new values for the specified fields.
(self, hour=None, minute=None, second=None, microsecond=None,
tzinfo=True, *, fold=None)
| 1719 | return offset |
| 1720 | |
| 1721 | def replace(self, hour=None, minute=None, second=None, microsecond=None, |
| 1722 | tzinfo=True, *, fold=None): |
| 1723 | """Return a new time with new values for the specified fields.""" |
| 1724 | if hour is None: |
| 1725 | hour = self.hour |
| 1726 | if minute is None: |
| 1727 | minute = self.minute |
| 1728 | if second is None: |
| 1729 | second = self.second |
| 1730 | if microsecond is None: |
| 1731 | microsecond = self.microsecond |
| 1732 | if tzinfo is True: |
| 1733 | tzinfo = self.tzinfo |
| 1734 | if fold is None: |
| 1735 | fold = self._fold |
| 1736 | return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold) |
| 1737 | |
| 1738 | __replace__ = replace |
| 1739 |