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

Method dst

Lib/_pydatetime.py:2245–2258  ·  view source on GitHub ↗

Return 0 if DST is not in effect, or the DST offset (as timedelta positive eastward) if DST is in effect. This is purely informational; the DST offset has already been added to the UTC offset returned by utcoffset() if applicable, so there's no need to consult dst()

(self)

Source from the content-addressed store, hash-verified

2243 return name
2244
2245 def dst(self):
2246 """Return 0 if DST is not in effect, or the DST offset (as timedelta
2247 positive eastward) if DST is in effect.
2248
2249 This is purely informational; the DST offset has already been added to
2250 the UTC offset returned by utcoffset() if applicable, so there's no
2251 need to consult dst() unless you're interested in displaying the DST
2252 info.
2253 """
2254 if self._tzinfo is None:
2255 return None
2256 offset = self._tzinfo.dst(self)
2257 _check_utc_offset("dst", offset)
2258 return offset
2259
2260 # Comparisons of datetime objects with other.
2261

Callers 1

timetupleMethod · 0.95

Calls 2

_check_utc_offsetFunction · 0.85
dstMethod · 0.45

Tested by

no test coverage detected