> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 日期时间服务器工具

> 向模型提供一个或多个时区的当前日期和时间。

当提示依赖当前日期、星期几、时间或时区时，请使用 `phaseo:datetime`。

模型会决定何时调用工具。Phaseo 将解析后的时区和当前时间戳返回给模型，然后由模型撰写最终答案。

## 快速入门

```bash theme={null}
curl https://api.phaseo.app/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5-nano",
    "messages": [
      { "role": "user", "content": "What day of the week is it in Tokyo?" }
    ],
    "tools": [
      {
        "type": "phaseo:datetime",
        "parameters": {
          "timezones": ["Asia/Tokyo", "UTC"]
        }
      }
    ]
  }'
```

## 配置

```json theme={null}
{
  "type": "phaseo:datetime",
  "parameters": {
    "timezones": ["Europe/London", "UTC"]
  }
}
```

| 参数 | 类型 | 默认值 | 说明 |
| - | - | - | - |
| `timezones` | string\[] | `["UTC"]` | 一次工具调用最多返回 5 个 IANA 时区名称，例如 `["Europe/London", "UTC"]`。 |

## 工具结果

工具结果会为每个请求的时区包含一条记录。

```json theme={null}
{
  "timezones": [
    {
      "timezone": "Europe/London",
      "datetime": "2026-07-03T10:00:00.123+01:00"
    },
    {
      "timezone": "UTC",
      "datetime": "2026-07-03T09:00:00.123+00:00"
    }
  ]
}
```

## 用量

Datetime 调用会增加：

```json theme={null}
{
  "usage": {
    "server_tool_use": {
      "datetime_requests": 1
    }
  }
}
```

## 相关内容

* [服务器工具](./index.mdx)
* [工具调用](../tool-calling.mdx)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.