Return a new time with new values for the specified fields.
(self, hour=None, minute=None, second=None, microsecond=None,
tzinfo=True, *, fold=None)
| 1605 | return offset |
| 1606 | |
| 1607 | def replace(self, hour=None, minute=None, second=None, microsecond=None, |
| 1608 | tzinfo=True, *, fold=None): |
| 1609 | """Return a new time with new values for the specified fields.""" |
| 1610 | if hour is None: |
| 1611 | hour = self.hour |
| 1612 | if minute is None: |
| 1613 | minute = self.minute |
| 1614 | if second is None: |
| 1615 | second = self.second |
| 1616 | if microsecond is None: |
| 1617 | microsecond = self.microsecond |
| 1618 | if tzinfo is True: |
| 1619 | tzinfo = self.tzinfo |
| 1620 | if fold is None: |
| 1621 | fold = self._fold |
| 1622 | return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold) |
| 1623 | |
| 1624 | # Pickle support. |
| 1625 |