时区
代理、信封和提示的时区处理
OpenClaw 规范化时间戳,以便模型看到**单一参考时间**。
消息信封(默认为本地)
入站消息被包装在如下信封中:
[Provider ... 2026-01-05 16:26 PST] message text
信封中的时间戳**默认为主机本地时间**,精度为分钟。
您可以通过以下方式覆盖:
{
agents: {
defaults: {
envelopeTimezone: "local", // "utc" | "local" | "user" | IANA timezone
envelopeTimestamp: "on", // "on" | "off"
envelopeElapsed: "on", // "on" | "off"
},
},
}- ''envelopeTimezone: "utc"'' 在UTC使用。
- ''envelopeTimezone: "user"'' 在''agents.defaults.userTimezone''使用(主机时区在回退)。
- Use an explicit IANA timezone (e.g., `"Europe/Vienna"`) as a fixed offset.
- ''envelopeTimestamp: "off"'' removes absolute timestamps from envelope headers.
- ''envelopeElapsed: "off"'' 在経過时间后缀(''+2m''样式)删除。
#
例
Tool calls (''channels.discord.readMessages'', ''channels.slack.readMessages'', etc.) return **raw provider timestamps**.
[Signal Alice +1555 2026-01-18 00:19 PST] hello
固定时区:
[Signal Alice +1555 2026-01-18 06:19 GMT+1] hello
- ''timestampMs'' (UTC epoch milliseconds)
[Signal Alice +1555 +2m 2026-01-18T05:19Z] follow-up
系统提示的用户时区
Set ''agents.defaults.userTimezone'' to tell the model the user's local time zone. If it is
unset, OpenClaw resolves the **host timezone at runtime** (no config write).
系统提示包括:
- ''Current Date & Time''(ISO 8601 UTC文字列)
- ''Time format: 12-hour'' or ''24-hour''
系统提示词的用户时区
**Local (default):**
**Fixed timezone:**
{
agents: { defaults: { userTimezone: "America/Chicago" } },
}**Elapsed time:**
- ''Current Date & Time''部分钟(本地时间和时区)
- ''Time format: 12-hour''或''24-hour''
您可以使用 ''agents.defaults.timeFormat'' 控制提示格式(''auto'' | ''12'' | ''24'')。
完全那动作和示示例关于是、''日期和时间''请参阅。