Syntax
TO_DAYS(date)
Purpose
TO_DAYS() returns the number of days corresponding to the value of date. The number of days refers to the number of days from 0000-01-01.
Examples
obclient> SELECT TO_DAYS('2015-11-04'), TO_DAYS('20151104');
+-----------------------+---------------------+
| TO_DAYS('2015-11-04') | TO_DAYS('20151104') |
+-----------------------+---------------------+
| 736271 | 736271 |
+-----------------------+---------------------+
1 row in set