Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
60 |
formatted_time = local_time.strftime("%Y-%m-%d %H:%M:%S")
|
61 |
location_name = timezone.split('/')[-1].replace('_', ' ')
|
62 |
|
63 |
-
return f"{location_name}: {formatted_time} {tz_abbr} {formatted_offset}"
|
64 |
|
65 |
except Exception as e:
|
66 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
@@ -99,7 +99,7 @@ def get_weather(location: str = None, zipcode: int = None) -> str:
|
|
99 |
return "Error: Unexpected response format"
|
100 |
|
101 |
# Return the weather data in one line, comma separated
|
102 |
-
return f"The current Weather in {query}is: {weather_data[0]}, Temperature: {weather_data[1]}, Humidity: {weather_data[2]}"
|
103 |
|
104 |
except requests.exceptions.RequestException as e:
|
105 |
return f"Error fetching weather data: {str(e)}"
|
|
|
60 |
formatted_time = local_time.strftime("%Y-%m-%d %H:%M:%S")
|
61 |
location_name = timezone.split('/')[-1].replace('_', ' ')
|
62 |
|
63 |
+
return f"The current time in {location_name} is: {formatted_time} {tz_abbr} {formatted_offset}"
|
64 |
|
65 |
except Exception as e:
|
66 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
|
|
99 |
return "Error: Unexpected response format"
|
100 |
|
101 |
# Return the weather data in one line, comma separated
|
102 |
+
return f"The current Weather in {query} is: {weather_data[0]}, Temperature: {weather_data[1]}, Humidity: {weather_data[2]}"
|
103 |
|
104 |
except requests.exceptions.RequestException as e:
|
105 |
return f"Error fetching weather data: {str(e)}"
|