Appearance
时区(Timezones)
OpenClaw 对时间戳进行标准化,让模型看到统一的参考时间。
消息信封(默认本地时间)
入站消息会被包装在如下信封中:
[Provider ... 2026-01-05 16:26 PST] message text信封中的时间戳默认为主机本地时间,精度为分钟。
可通过以下配置覆盖:
json5
{
agents: {
defaults: {
envelopeTimezone: "local", // "utc" | "local" | "user" | IANA 时区
envelopeTimestamp: "on", // "on" | "off"
envelopeElapsed: "on", // "on" | "off"
},
},
}envelopeTimezone: "utc":使用 UTC。envelopeTimezone: "user":使用agents.defaults.userTimezone(回退到主机时区)。- 使用显式 IANA 时区(如
"Europe/Vienna")以固定偏移量。 envelopeTimestamp: "off":从信封头移除绝对时间戳。envelopeElapsed: "off":移除经过时间后缀(如+2m样式)。
示例
本地时间(默认):
[Signal Alice +1555 2026-01-18 00:19 PST] hello固定时区:
[Signal Alice +1555 2026-01-18 06:19 GMT+1] hello经过时间:
[Signal Alice +1555 +2m 2026-01-18T05:19Z] follow-up工具载荷(原始提供商数据 + 标准化字段)
工具调用(channels.discord.readMessages、channels.slack.readMessages 等)返回原始提供商时间戳。为保持一致性,我们还附加了标准化字段:
timestampMs(UTC 纪元毫秒)timestampUtc(ISO 8601 UTC 字符串)
原始提供商字段被完整保留,不会丢失。
系统提示词中的用户时区
设置 agents.defaults.userTimezone 可告知模型用户的本地时区。如果未设置,OpenClaw 会在运行时解析主机时区(不写入配置)。
json5
{
agents: { defaults: { userTimezone: "America/Chicago" } },
}系统提示词将包含:
Current Date & Time章节,显示本地时间和时区Time format: 12-hour或24-hour
可通过 agents.defaults.timeFormat(auto | 12 | 24)控制提示词格式。
完整行为和示例详见Date & Time。