The TO_DAYS() function returns the number of days since the start of the default calendar 0000-00-00 by specifying "Date".
The function is not intended for use with dates prior to the introduction of the Gregorian calendar in 1582.
The results are not reliable because the function does not take into account lost days due to the Julian calendar change.
The minimum value to get a result is 0001-01-01. Smaller values or invalid values result in the return of NULL.
If the value of "Date" is NULL, the FROM_DAYS() function returns NULL.
The opposite of the TO_DAYS() function is the FROM_DAYS() function.