MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _local_timezone

Method _local_timezone

tools/python-3.11.9-amd64/Lib/datetime.py:1956–1966  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1954 microsecond, tzinfo, fold=fold)
1955
1956 def _local_timezone(self):
1957 if self.tzinfo is None:
1958 ts = self._mktime()
1959 else:
1960 ts = (self - _EPOCH) // timedelta(seconds=1)
1961 localtm = _time.localtime(ts)
1962 local = datetime(*localtm[:6])
1963 # Extract TZ data
1964 gmtoff = localtm.tm_gmtoff
1965 zone = localtm.tm_zone
1966 return timezone(timedelta(seconds=gmtoff), zone)
1967
1968 def astimezone(self, tz=None):
1969 if tz is None:

Callers 1

astimezoneMethod · 0.95

Calls 4

_mktimeMethod · 0.95
timedeltaClass · 0.85
datetimeClass · 0.85
timezoneClass · 0.70

Tested by

no test coverage detected