diff options
Diffstat (limited to 'searx/weather.py')
| -rw-r--r-- | searx/weather.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/searx/weather.py b/searx/weather.py index 793dc09c4..cb10181a0 100644 --- a/searx/weather.py +++ b/searx/weather.py @@ -20,6 +20,7 @@ import typing import base64 import datetime import dataclasses +import zoneinfo from urllib.parse import quote_plus @@ -137,6 +138,10 @@ class GeoLocation: country_code: str # 2-Character ISO-3166-1 alpha2 country code. E.g. DE for Germany timezone: str # Time zone using time zone database definitions + @property + def zoneinfo(self) -> zoneinfo.ZoneInfo: + return zoneinfo.ZoneInfo(self.timezone) + def __str__(self): return self.name |