From 5ec748b21299128de254d5cf54c383c7008e7210 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn <github@nathan.woodburn.au> Date: Thu, 6 Mar 2025 15:25:21 +1100 Subject: [PATCH] feat: Remove tz from output time --- server.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server.py b/server.py index b28738d..635e9be 100644 --- a/server.py +++ b/server.py @@ -159,7 +159,7 @@ def convert(): return jsonify( { "from": from_tz_time.strftime("%Y-%m-%d %H:%M:%S %Z"), - "to": to_tz_time.strftime("%Y-%m-%d %H:%M:%S %Z"), + "to": to_tz_time.strftime("%Y-%m-%d %H:%M:%S"), } ) @@ -187,10 +187,7 @@ def convert_multiple(): results = {} for original_tz, tz in to_tz_list: to_tz_time = from_tz_time.astimezone(tz) - offset = to_tz_time.strftime('%z') - offset_formatted = f"UTC{offset[:3]}:{offset[3:]}" if offset else "" - tz_name = to_tz_time.tzname() if to_tz_time.tzname() else offset_formatted - results[original_tz] = f"{to_tz_time.strftime('%Y-%m-%d %H:%M:%S')} {tz_name}" + results[original_tz] = f"{to_tz_time.strftime('%Y-%m-%d %H:%M:%S')}" except Exception as e: return jsonify({"error": str(e)}), 400