使用指南SQL 手册SQL 函数日期函数to_days本页总览to_daysto_days description Syntax INT TO_DAYS(DATETIME date) 返回date距离0000-01-01的天数 参数为Date或者Datetime类型 example mysql> select to_days('2007-10-07');+-----------------------+| to_days('2007-10-07') |+-----------------------+| 733321 |+-----------------------+ keywords TO_DAYS,TO,DAYS