pwinslow commited on
Commit
dbb0ec4
·
verified ·
1 Parent(s): 4dd5b26

fix timezone converter bug

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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: