SQL ReferenceSQL 函数日期函数TO_DAYS本页总览TO_DAYSto_daysdescriptionSyntaxINT TO_DAYS(DATETIME date)返回date距离0000-01-01的天数参数为Date或者Datetime类型examplemysql> select to_days('2007-10-07');+-----------------------+| to_days('2007-10-07') |+-----------------------+| 733321 |+-----------------------+keywordsTO_DAYS,TO,DAYS