Da-Rabbit-Hole commited on
Commit
de66fb0
·
verified ·
1 Parent(s): ba69364

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -34,15 +34,15 @@ def get_current_time_in_timezone(timezone: str): str
34
  Returns:
35
  The current local time in the string format %Y-%m-%d %H:%M:%S (e.g., '2015-09-14 04:20:00')
36
  """
37
- try:
38
- # Create timezone object
39
- tz = pytz.timezone(timezone)
40
 
41
- # Get current time in that timezone
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
 
45
- except Exception as e:
46
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
47
 
48
 
 
34
  Returns:
35
  The current local time in the string format %Y-%m-%d %H:%M:%S (e.g., '2015-09-14 04:20:00')
36
  """
37
+ try:
38
+ # Create timezone object
39
+ tz = pytz.timezone(timezone)
40
 
41
+ # Get current time in that timezone
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
 
45
+ except Exception as e:
46
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
47
 
48