MCPcopy Index your code
hub / github.com/RustPython/RustPython / _find_ti

Method _find_ti

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

Source from the content-addressed store, hash-verified

6516 return dt
6517
6518 def _find_ti(self, dt, i):
6519 timestamp = ((dt.toordinal() - self.EPOCHORDINAL) * 86400
6520 + dt.hour * 3600
6521 + dt.minute * 60
6522 + dt.second)
6523 lt = self.lt[dt.fold]
6524 idx = bisect.bisect_right(lt, timestamp)
6525
6526 return self.ti[max(0, idx - 1)][i]
6527
6528 def utcoffset(self, dt):
6529 return self._find_ti(dt, 0)

Callers 3

utcoffsetMethod · 0.95
dstMethod · 0.95
tznameMethod · 0.95

Calls 2

maxFunction · 0.85
toordinalMethod · 0.80

Tested by

no test coverage detected