Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,14 +36,13 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 36 |
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
| 37 |
"""
|
| 38 |
try:
|
| 39 |
-
# Create timezone object
|
| 40 |
tz = pytz.timezone(timezone)
|
| 41 |
-
|
| 42 |
-
local_time = datetime.datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|
| 43 |
return f"The current local time in {timezone} is: {local_time}"
|
| 44 |
except Exception as e:
|
| 45 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 46 |
|
|
|
|
| 47 |
|
| 48 |
final_answer = FinalAnswerTool()
|
| 49 |
|
|
|
|
| 36 |
timezone: A string representing a valid timezone (e.g., 'America/New_York').
|
| 37 |
"""
|
| 38 |
try:
|
|
|
|
| 39 |
tz = pytz.timezone(timezone)
|
| 40 |
+
local_time = datetime.now(tz).strftime("%Y-%m-%d %H:%M:%S")
|
|
|
|
| 41 |
return f"The current local time in {timezone} is: {local_time}"
|
| 42 |
except Exception as e:
|
| 43 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 44 |
|
| 45 |
+
|
| 46 |
|
| 47 |
final_answer = FinalAnswerTool()
|
| 48 |
|