Spaces:
Sleeping
Sleeping
fix timezone converter bug
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ def convert_timezone(dt: datetime, target_tz: str) -> str:
|
|
| 31 |
if dt.tzinfo is None:
|
| 32 |
raise ValueError("dt must be timezone-aware")
|
| 33 |
|
| 34 |
-
return f"When time in {dt.tzinfo} is {dt.strftime('%Y-%m-%d %H:%M:%S')}, the time in {target_tz} is: {dt.astimezone(ZoneInfo(target_tz)).strftime('%Y-%m-%d %H:%M:%S')}
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 31 |
if dt.tzinfo is None:
|
| 32 |
raise ValueError("dt must be timezone-aware")
|
| 33 |
|
| 34 |
+
return f"When time in {dt.tzinfo} is {dt.strftime('%Y-%m-%d %H:%M:%S')}, the time in {target_tz} is: {dt.astimezone(ZoneInfo(target_tz)).strftime('%Y-%m-%d %H:%M:%S')}"
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_current_time_in_timezone(timezone: str) -> str:
|