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

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

# Date32

日期。支持从 `1900-01-01` 到 `2299-12-31` 的日期范围。以原生字节序存储为有符号 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}
-- Parse Date
-- - from string,
-- - from 'small' integer interpreted as number of days since 1970-01-01, and
-- - from 'big' integer interpreted as number of seconds since 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](/docs/zh/reference/functions/regular-functions/type-conversion-functions#toDate32)
* [toDate32OrZero](/docs/zh/reference/functions/regular-functions/type-conversion-functions#toDate32OrZero)
* [toDate32OrNull](/docs/zh/reference/functions/regular-functions/type-conversion-functions#toDate32OrNull)
