generated from nathanwoodburn/python-webserver-template
parent
6d7019bba5
commit
f2c29f4073
@ -126,7 +126,10 @@ def get_full_timezone(tz):
|
|||||||
minutes = int(match.group(2)) if match.group(2) else 0
|
minutes = int(match.group(2)) if match.group(2) else 0
|
||||||
return pytz.FixedOffset(hours * 60 + minutes)
|
return pytz.FixedOffset(hours * 60 + minutes)
|
||||||
full_tz = SHORT_TZ_MAP.get(tz, tz)
|
full_tz = SHORT_TZ_MAP.get(tz, tz)
|
||||||
return pytz.timezone(full_tz) if isinstance(full_tz, str) else None
|
try:
|
||||||
|
return pytz.timezone(full_tz) if isinstance(full_tz, str) else None
|
||||||
|
except pytz.UnknownTimeZoneError:
|
||||||
|
return None
|
||||||
|
|
||||||
@app.route("/api/v1/convert", methods=["POST"])
|
@app.route("/api/v1/convert", methods=["POST"])
|
||||||
def convert():
|
def convert():
|
||||||
|
Loading…
Reference in New Issue
Block a user