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

# 日期時間工具

> 將當前日期和時間注入模型上下文。datetime Server Tool 讓模型獲得準確的時間感知，無需系統提示 hack。

`datetime` Server Tool 為模型提供當前的日期和時間。

## 快速開始

```json theme={null}
{
  "model": "openai/gpt-5.4",
  "messages": [{"role": "user", "content": "What day of the week is today, and how many days until the end of the year?"}],
  "tools": [{"type": "arouter", "arouter": {"id": "datetime"}}]
}
```

## 設定

| 參數         | 類型       | 預設值     | 描述                                                                      |
| ---------- | -------- | ------- | ----------------------------------------------------------------------- |
| `id`       | `string` | —       | 必須為 `"datetime"`                                                        |
| `timezone` | `string` | `"UTC"` | IANA 時區識別符（例如 `"America/New_York"`、`"Asia/Shanghai"`、`"Europe/London"`） |

## 工具回應格式

```json theme={null}
{
  "datetime": "2026-04-03T14:32:00Z",
  "date": "2026-04-03",
  "time": "14:32:00",
  "timezone": "UTC",
  "day_of_week": "Friday",
  "unix_timestamp": 1775319120
}
```

## 使用情境

**排程與規劃：**

```python theme={null}
response = client.chat.completions.create(
    model="openai/gpt-5.4",
    messages=[{"role": "user", "content": "Create a 2-week project plan starting from today."}],
    tools=[{"type": "arouter", "arouter": {"id": "datetime", "timezone": "Asia/Shanghai"}}],
)
```

## 定價

`datetime` 工具是**免費**的——除正常 LLM Token 費用外不收取額外費用。

## 下一步

* [網頁搜尋工具](/zh-Hant/guides/features/server-tools/web-search)
* [Server Tools 概覽](/zh-Hant/guides/features/server-tools/overview)
