> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ClickHouse 中 Date 数据类型的文档

# Date

一种日期类型。以自 1970-01-01 起的天数 (无符号) 形式用两个字节存储。可存储的值范围从 Unix 纪元开始后不久，一直到编译阶段由常量定义的上限 (目前截至 2149 年，但最终完全支持的年份为 2148 年) 。

支持的值范围：\[1970-01-01, 2149-06-06]。

日期值存储时不包含时区信息。

**示例**

创建一个包含 `Date` 类型列的表，并向其中插入数据：

```sql theme={null}
CREATE TABLE dt
(
    `timestamp` Date,
    `event_id` UInt8
)
ENGINE = TinyLog;
```

```sql theme={null}
-- 解析 Date
-- - 从字符串，
-- - 从"小"整数（解释为自 1970-01-01 起的天数），以及
-- - 从"大"整数（解释为自 1970-01-01 起的秒数）。
INSERT INTO dt VALUES ('2019-01-01', 1), (17897, 2), (1546300800, 3);

SELECT * FROM dt;
```

```text theme={null}
┌──timestamp─┬─event_id─┐
│ 2019-01-01 │        1 │
│ 2019-01-01 │        2 │
│ 2019-01-01 │        3 │
└────────────┴──────────┘
```

**另请参阅**

* [日期和时间函数](/zh/reference/functions/regular-functions/date-time-functions)
* [日期和时间运算符](/zh/reference/operators#operators-for-working-with-dates-and-times)
* [`DateTime` 数据类型](/zh/reference/data-types/datetime)
