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(未设置时回退为主机时区)。- 也可指定 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 会在运行时解析主机时区(不会写回配置):
{
agents: { defaults: { userTimezone: "America/Chicago" } }
}
系统提示词会包含:
Current Date & Time部分(本地时间 + 时区)Time format: 12-hour或24-hour
可用 agents.defaults.timeFormat 控制提示词时间格式(auto | 12 | 24)。完整行为与示例请参考 Date & Time。