MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / _subtract_timedelta

Method _subtract_timedelta

src/pendulum/datetime.py:690–699  ·  view source on GitHub ↗

Remove timedelta duration from the instance.

(self, delta: datetime.timedelta)

Source from the content-addressed store, hash-verified

688 return self.add(seconds=delta.total_seconds())
689
690 def _subtract_timedelta(self, delta: datetime.timedelta) -> Self:
691 """
692 Remove timedelta duration from the instance.
693 """
694 if isinstance(delta, pendulum.Duration):
695 return self.subtract(
696 years=delta.years, months=delta.months, seconds=delta._total
697 )
698
699 return self.subtract(seconds=delta.total_seconds())
700
701 # DIFFERENCES
702

Callers 1

__sub__Method · 0.95

Calls 2

subtractMethod · 0.95
total_secondsMethod · 0.45

Tested by

no test coverage detected