update compose.yml to mount system time and tz

This commit is contained in:
roeseth
2025-03-10 19:07:45 -07:00
parent 16622887de
commit 8b247054bb
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -12,3 +12,5 @@ services:
- "11451:11451" # optional, gewechat default port
volumes:
- ./data:/AstrBot/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
+2 -1
View File
@@ -1098,8 +1098,9 @@ UID: {user_id} 此 ID 可用于设置管理员。
req.prompt = user_info + req.prompt
if self.enable_datetime:
# Including timezone
current_time = (
datetime.datetime.now().astimezone().strftime("%Y-%m-%d %H:%M")
datetime.datetime.now().astimezone().strftime("%Y-%m-%d %H:%M (%Z)")
)
req.system_prompt += f"\nCurrent datetime: {current_time}\n"