to_days() 是一个 MySQL 日期/时间函数。它用于将日期转换为数字天数。
语法
select to_days(date);
参数:
date: 要转换为天数的日期。
示例 1
select to_Days('2023-01-03');
输出:
mysql> select to_Days('2023-01-03');
+-----------------------+
| to_Days('2023-01-03') |
+-----------------------+
| 738888 |
+-----------------------+
1 row in set (0.00 sec)
示例 2
select to_Days('1995-02-11');
输出:
mysql> select to_Days('1995-02-11');
+-----------------------+
| to_Days('1995-02-11') |
+-----------------------+
| 728700 |
+-----------------------+
1 row in set (0.00 sec)