MCPcopy Create free account
hub / github.com/python/cpython / year_to_epoch

Method year_to_epoch

Lib/zoneinfo/_zoneinfo.py:534–544  ·  view source on GitHub ↗
(self, year)

Source from the content-addressed store, hash-verified

532 self.second = second
533
534 def year_to_epoch(self, year):
535 days_before_year = _post_epoch_days_before_year(year)
536
537 d = self.d
538 if self.julian and d >= 59 and calendar.isleap(year):
539 d += 1
540
541 epoch = (days_before_year + d) * 86400
542 epoch += self.hour * 3600 + self.minute * 60 + self.second
543
544 return epoch
545
546
547class _CalendarOffset:

Callers 1

transitionsMethod · 0.45

Calls 1

Tested by

no test coverage detected