(self, ts, year)
| 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 | |
| 510 | def _post_epoch_days_before_year(year): |
nothing calls this directly
no test coverage detected