(self, dt)
| 5792 | return self.stdoffset + self.dst(dt) |
| 5793 | |
| 5794 | def dst(self, dt): |
| 5795 | if dt is None or dt.tzinfo is None: |
| 5796 | # An exception instead may be sensible here, in one or more of |
| 5797 | # the cases. |
| 5798 | return ZERO |
| 5799 | assert dt.tzinfo is self |
| 5800 | |
| 5801 | # Find first Sunday in April. |
| 5802 | start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year)) |
| 5803 | assert start.weekday() == 6 and start.month == 4 and start.day <= 7 |
| 5804 | |
| 5805 | # Find last Sunday in October. |
| 5806 | end = first_sunday_on_or_after(DSTEND.replace(year=dt.year)) |
| 5807 | assert end.weekday() == 6 and end.month == 10 and end.day >= 25 |
| 5808 | |
| 5809 | # Can't compare naive to aware objects, so strip the timezone from |
| 5810 | # dt first. |
| 5811 | if start <= dt.replace(tzinfo=None) < end: |
| 5812 | return HOUR |
| 5813 | else: |
| 5814 | return ZERO |
| 5815 | |
| 5816 | Eastern = USTimeZone(-5, "Eastern", "EST", "EDT") |
| 5817 | Central = USTimeZone(-6, "Central", "CST", "CDT") |
no test coverage detected