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

> ClickHouse 中 Date32 数据类型的文档；与 Date 相比，它支持更大的日期范围

# Date32

日期。支持与 [DateTime64](/zh/reference/data-types/datetime64) 相同的日期范围。以原生字节序存储为有符号 32 位整数，其值表示自 `1900-01-01` 起的天数。**重要！** 0 表示 `1970-01-01`，负值表示 `1970-01-01` 之前的天数。

**示例**

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

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

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

SELECT * FROM dt32;
```

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

**另见**

* [toDate32](/zh/reference/functions/regular-functions/type-conversion-functions#toDate32)
* [toDate32OrZero](/zh/reference/functions/regular-functions/type-conversion-functions#toDate32OrZero)
* [toDate32OrNull](/zh/reference/functions/regular-functions/type-conversion-functions#toDate32OrNull)
