Converts a datetime to the local timezone, or the system timezone.
(self, dt: datetime)
| 149 | return dt.astimezone(tz=None) |
| 150 | |
| 151 | def to_local_fallback(self, dt: datetime) -> datetime: |
| 152 | """Converts a datetime to the local timezone, or the system timezone.""" |
| 153 | if is_naive(dt): |
| 154 | return make_aware(dt, self.local) |
| 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.""" |