跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt

Use this file to discover all available pages before exploring further.

OpenClaw 会对时间戳进行标准化,这样模型看到的是单一参考时间

消息 envelope(默认使用本地时间)

入站消息会被包装成如下 envelope:
[Provider ... 2026-01-05 16:26 PST] message text
envelope 中的时间戳默认是主机本地时间,精确到分钟。 你可以通过以下配置进行覆盖:
{
  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" 会从 envelope 标头中移除绝对时间戳。
  • 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.readMessageschannels.slack.readMessages 等)会返回原始提供商时间戳。 我们还会附加标准化字段以保持一致性:
  • timestampMs(UTC epoch 毫秒)
  • timestampUtc(ISO 8601 UTC 字符串)
原始提供商字段会被保留。

用于系统提示词的用户时区

设置 agents.defaults.userTimezone,告诉模型用户的本地时区。如果它 未设置,OpenClaw 会在运行时解析主机时区(不会写入配置)。
{
  agents: { defaults: { userTimezone: "America/Chicago" } },
}
系统提示词中会包含:
  • Current Date & Time 部分,带本地时间和时区
  • Time format: 12-hour24-hour
你可以通过 agents.defaults.timeFormatauto | 12 | 24)控制提示词格式。 完整行为和示例请参见 Date & Time

相关内容

  • Heartbeat — 活跃时段会使用时区进行调度
  • Cron Jobs — cron 表达式会使用时区进行调度
  • Date & Time — 完整的日期/时间行为与示例