Skip to content

Commit c511aa6

Browse files
common-mcps
1 parent 1fd2755 commit c511aa6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

homeGPT/src/mcps/common/functions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Dict, Any, Optional, TypeVar, Callable, Awaitable, cast
2+
import os
23
import functools
34
import inspect
45
import logging
@@ -70,12 +71,11 @@ async def get_time(
7071
Dictionary with current time information
7172
"""
7273
if timezone_name is None:
73-
now = datetime.now()
74-
tz_info = "Local"
75-
else:
76-
tz = pytz.timezone(timezone_name)
77-
now = datetime.now(tz)
78-
tz_info = timezone_name
74+
timezone_name = os.getenv("TIMEZONE", "America/Chicago")
75+
76+
tz = pytz.timezone(timezone_name)
77+
now = datetime.now(tz)
78+
tz_info = timezone_name
7979

8080
return {
8181
"current_time": now.strftime("%Y-%m-%d %H:%M:%S"),

0 commit comments

Comments
 (0)