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

Method fromutc

src/pendulum/tz/timezone.py:227–229  ·  view source on GitHub ↗
(self, dt: _datetime.datetime)

Source from the content-addressed store, hash-verified

225 return _datetime.timedelta()
226
227 def fromutc(self, dt: _datetime.datetime) -> _datetime.datetime:
228 # Use the stdlib datetime's add method to avoid infinite recursion
229 return (_datetime.datetime.__add__(dt, self._utcoffset)).replace(tzinfo=self)
230
231 def tzname(self, dt: _datetime.datetime | None) -> str | None:
232 return self._name

Callers

nothing calls this directly

Calls 2

replaceMethod · 0.45
__add__Method · 0.45

Tested by

no test coverage detected