AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

[Bug] 使用Docker运行AstrBot,变成了UTC时间

Open FitzzZOwO opened this issue 1 year ago • 1 comments

发生了什么

使用Docker运行AstrBot,变成了UTC时间

如何复现?

1

AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

AstrBot v3.4.37 Docker Ubuntu

操作系统

Linux

报错日志

fitz@iZ2vc5dobammiwfkrfk4j4Z:~$ timedatectl Local time: Mon 2025-03-10 18:05:56 CST Universal time: Mon 2025-03-10 10:05:56 UTC RTC time: Mon 2025-03-10 10:05:56 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: yes NTP service: active RTC in local TZ: no

[10:05:20] [Core] [DBUG] [platform.register:45]: 平台适配器 webchat 已注册 [10:05:21] [Core] [INFO] [AstrBot.main:47]: 管理面板文件已是最新。 [10:05:21] [Core] [INFO] [AstrBot.main:80]: ___ _... . ______ .___________. / \ / | || _ \ | _ \ / __ \ | | / ^ \ | (-------| |----| |) | | |) | | | | | ---| |---- / /\ \ \ \ | | | / | _ < | | | | | | / _____ \ .----) | | | | |\ ----.| |) | | --' | | | /__/ \__\ |_______/ |__| | _| .||/ ____/ ||

[10:05:21] [Core] [INFO] [core.core_lifecycle:37]: AstrBot v3.4.37 [10:05:21] [Core] [INFO] [star.star_manager:246]: 正在载入插件 astrbot_plugin_sysinfo ... [10:05:21] [Core] [INFO] [star.star_manager:246]: 正在载入插件 astrbot_plugin_steamshot ...

你愿意提交 PR 吗?

  • [ ] 是的,我愿意提交 PR!

Code of Conduct

  • [x] 我已阅读并同意遵守该项目的 行为准则。

FitzzZOwO avatar Mar 10 '25 10:03 FitzzZOwO

Docker默认不同步host system time,请在Docker内运行 date 检查时间。

最近Merge了PR: #744 , 因为照顾不同时区用户。 可以在运行Docker时映射系统时间和时区:

-v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro

Windows WSL2 用户

-v \\wsl.localhost\Ubuntu-20.04\etc\timezone:/etc/timezone:ro
-v \\wsl.localhost\Ubuntu-20.04\etc\localtime:/etc/localtime:ro

将会update doc。另外可能再更新一下包含时区信息。

roeseth avatar Mar 11 '25 01:03 roeseth