MCPcopy Index your code
hub / github.com/python/cpython / utcoffset

Method utcoffset

Lib/_pydatetime.py:1684–1691  ·  view source on GitHub ↗

Return the timezone offset as timedelta, positive east of UTC (negative west of UTC).

(self)

Source from the content-addressed store, hash-verified

1682 # Timezone functions
1683
1684 def utcoffset(self):
1685 """Return the timezone offset as timedelta, positive east of UTC
1686 (negative west of UTC)."""
1687 if self._tzinfo is None:
1688 return None
1689 offset = self._tzinfo.utcoffset(None)
1690 _check_utc_offset("utcoffset", offset)
1691 return offset
1692
1693 def tzname(self):
1694 """Return the timezone name.

Callers 10

_cmpMethod · 0.95
_tzstrMethod · 0.95
_wrap_strftimeFunction · 0.45
fromutcMethod · 0.45
__hash__Method · 0.45
astimezoneMethod · 0.45
utcoffsetMethod · 0.45
_cmpMethod · 0.45
__sub__Method · 0.45
__hash__Method · 0.45

Calls 1

_check_utc_offsetFunction · 0.85

Tested by

no test coverage detected