Returns ZoneInfo timezone if the provided zone is a string, otherwise return the zone.
(self, zone: str | tzinfo)
| 155 | return localize(dt, self.local) |
| 156 | |
| 157 | def get_timezone(self, zone: str | tzinfo) -> tzinfo: |
| 158 | """Returns ZoneInfo timezone if the provided zone is a string, otherwise return the zone.""" |
| 159 | if isinstance(zone, str): |
| 160 | return ZoneInfo(zone) |
| 161 | return zone |
| 162 | |
| 163 | @cached_property |
| 164 | def local(self) -> tzinfo: |
no outgoing calls