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

Method _find_ti

Lib/test/datetimetester.py:6705–6713  ·  view source on GitHub ↗
(self, dt, i)

Source from the content-addressed store, hash-verified

6703 return dt
6704
6705 def _find_ti(self, dt, i):
6706 timestamp = ((dt.toordinal() - self.EPOCHORDINAL) * 86400
6707 + dt.hour * 3600
6708 + dt.minute * 60
6709 + dt.second)
6710 lt = self.lt[dt.fold]
6711 idx = bisect.bisect_right(lt, timestamp)
6712
6713 return self.ti[max(0, idx - 1)][i]
6714
6715 def utcoffset(self, dt):
6716 return self._find_ti(dt, 0)

Callers 3

utcoffsetMethod · 0.95
dstMethod · 0.95
tznameMethod · 0.95

Calls 1

toordinalMethod · 0.80

Tested by

no test coverage detected