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

> ClickHouse の Date32 データ型に関するドキュメントです。Date と比べてより広い範囲の日付を格納できます

# Date32

日付を表します。[DateTime64](/ja/reference/data-types/datetime64) と同じ日付範囲をサポートします。値は `1900-01-01` からの日数を表し、native バイト順序の符号付き 32 ビット整数として格納されます。**重要!** 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](/ja/reference/functions/regular-functions/type-conversion-functions#toDate32)
* [toDate32OrZero](/ja/reference/functions/regular-functions/type-conversion-functions#toDate32OrZero)
* [toDate32OrNull](/ja/reference/functions/regular-functions/type-conversion-functions#toDate32OrNull)
