Syntax
TO_DAYS(date)
Purpose
You can call this function to return the number of days that corresponds 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 (0.01 sec)