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

# to_days

> 返回指定日期距离0000-01-01的天数。

返回指定日期距离 `0000-01-01` 的天数。

参数必须为 DATE 或 DATETIME 类型。

## 语法

```Haskell theme={null}
INT TO_DAYS(DATETIME date)
```

## 示例

```Plain Text theme={null}
select to_days('2007-10-07');
+-----------------------+
| to_days('2007-10-07') |
+-----------------------+
|                733321 |
+-----------------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.