MySQL TO_DAYS() Function
Definition and Usage
The TO_DAYS() function converts a date into numeric days.
The TO_DAYS() function is to be used only with dates within the Gregorian calendar.
Note: The TO_DAYS() function is the reverse of the FROM_DAYS() function.
Syntax
  TO_DAYS(date)Parameter Values
| Parameter | Description | 
|---|---|
| date | Required. The date to convert to a numeric day. If date is "0000-00-00", TO_DAYS() will return NULL | 
Technical Details
| Works in: | MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23 | 
|---|

