TO_DAYS (date) specifies a date, and returns a number of days (days starting from 0 in the year ). The rules in MySQL "date and time type" convert the two-digit year value in the date to four digits. For example, '1970-10-07' and '97-10-07' are treated as the same date. for the date before January 1, 1997 (maybe another region is the next year ), the result of this function is unreliable.
TO_DAYS (date)
Returns the number of days for a given date (the number of days starting from 0 in the year ). The rules in MySQL "date and time type" convert the two-digit year value in the date to four digits. For example, '1970-10-07' and '97-10-07' are treated as the same date. for the date before January 1, 1997 (maybe another region is the next year ), the result of this function is unreliable.
Instance:
SELECT TO_DAYS ('2017-10-31 ')
Value: 736267