Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query
optimization, and usability that you won’t want to miss.
Returns the day number of the input date object. Day number starts with 1 being 0000-01-01 and counts sequentially.
TO_DAYS ( dateobj )
Integer
select to_days('0000-01-01');
+-----------------------+
| to_days('0000-01-01') |
+-----------------------+
| 1 |
+-----------------------+
select to_days('2016-03-23 08:17:01');
+--------------------------------+
| to_days('2016-03-23 08:17:01') |
+--------------------------------+
| 736411 |
+--------------------------------+