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

Method _get_trans_info_fromutc

Lib/zoneinfo/_zoneinfo.py:485–507  ·  view source on GitHub ↗
(self, ts, year)

Source from the content-addressed store, hash-verified

483 return self.dst if isdst else self.std
484
485 def _get_trans_info_fromutc(self, ts, year):
486 start, end = self.transitions(year)
487 start -= self.std.utcoff.total_seconds()
488 end -= self.dst.utcoff.total_seconds()
489
490 if start < end:
491 isdst = start <= ts < end
492 else:
493 isdst = not (end <= ts < start)
494
495 # For positive DST, the ambiguous period is one dst_diff after the end
496 # of DST; for negative DST, the ambiguous period is one dst_diff before
497 # the start of DST.
498 if self.dst_diff > 0:
499 ambig_start = end
500 ambig_end = end + self.dst_diff
501 else:
502 ambig_start = start
503 ambig_end = start - self.dst_diff
504
505 fold = ambig_start <= ts < ambig_end
506
507 return (self.dst if isdst else self.std, fold)
508
509
510def _post_epoch_days_before_year(year):

Callers

nothing calls this directly

Calls 2

transitionsMethod · 0.95
total_secondsMethod · 0.80

Tested by

no test coverage detected