Appearance
日期与时间
OpenClaw 默认对传输时间戳使用宿主本地时间,只在系统提示中使用用户时区。提供商时间戳被保留,工具保持其原生语义(当前时间可通过 session_status 获取)。
消息信封(默认本地时间)
入站消息被包装成带时间戳(分钟精度)的信封:
[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: "local"使用宿主时区。envelopeTimezone: "user"使用agents.defaults.userTimezone(回退到宿主时区)。- 使用显式 IANA 时区(如
"America/Chicago")指定固定时区。 envelopeTimestamp: "off"从信封头中移除绝对时间戳。envelopeElapsed: "off"移除经过时间后缀(+2m风格)。
示例
本地(默认):
[WhatsApp +1555 2026-01-18 00:19 PST] hello用户时区:
[WhatsApp +1555 2026-01-18 00:19 CST] hello启用经过时间:
[WhatsApp +1555 +30s 2026-01-18T05:19Z] follow-up系统提示:当前日期与时间
若用户时区已知,系统提示包含专用的当前日期与时间部分,仅包含时区(无时钟/时间格式),以保持提示缓存稳定:
Time zone: America/Chicago当代理需要当前时间时,使用 session_status 工具——这是让你的小龙虾知道"现在几点"的正确方式;状态卡片中包含时间戳行。
系统事件行(默认本地时间)
插入代理上下文的排队系统事件使用与消息信封相同的时区选择(默认:宿主本地时间)作为前缀:
System: [2026-01-12 12:19:17 PST] Model switched.配置用户时区 + 格式
json5
{
agents: {
defaults: {
userTimezone: "America/Chicago",
timeFormat: "auto", // auto | 12 | 24
},
},
}userTimezone设置提示上下文的用户本地时区。timeFormat控制提示中的12h/24h 显示。auto遵循 OS 偏好。
时间格式检测(auto)
当 timeFormat: "auto" 时,OpenClaw 检查 OS 偏好(macOS/Windows)并回退到区域设置格式。检测值每进程缓存以避免重复系统调用。
工具载荷 + 连接器(原始提供商时间 + 规范化字段)
频道工具返回提供商原生时间戳并添加规范化字段以保证一致性:
timestampMs:纪元毫秒(UTC)timestampUtc:ISO 8601 UTC 字符串
原始提供商字段被保留,不会丢失任何信息。
- Slack:来自 API 的纪元式字符串
- Discord:UTC ISO 时间戳
- Telegram/WhatsApp:提供商特定的数字/ISO 时间戳
若需要本地时间,使用已知时区在下游转换。