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

Method diff

src/pendulum/datetime.py:703–712  ·  view source on GitHub ↗

Returns the difference between two DateTime objects represented as an Interval.

(  # type: ignore[override]
        self, dt: datetime.datetime | None = None, abs: bool = True
    )

Source from the content-addressed store, hash-verified

701 # DIFFERENCES
702
703 def diff( # type: ignore[override]
704 self, dt: datetime.datetime | None = None, abs: bool = True
705 ) -> Interval[datetime.datetime]:
706 """
707 Returns the difference between two DateTime objects represented as an Interval.
708 """
709 if dt is None:
710 dt = self.now(self.tz)
711
712 return Interval(self, dt, absolute=abs)
713
714 def diff_for_humans( # type: ignore[override]
715 self,

Callers 5

diff_for_humansMethod · 0.95
averageMethod · 0.95
__rsub__Method · 0.95
ageMethod · 0.45
__sub__Method · 0.45

Calls 2

nowMethod · 0.95
IntervalClass · 0.90

Tested by

no test coverage detected