Loading lesson path
Concept visual
Start at both ends
Return the number of days between the date and year 0:
SELECT TO_DAYS("2017-06-20");The TO_DAYS() function returns the number of days between a date and year 0
Formula
(date "0000 - 00 - 00").The TO_DAYS() function can be used only with dates within the Gregorian calendar.
FROM_DAYS() function.
TO_DAYS( date )
Required. The given date
From MySQL 4.0
Return the number of days between the date and year 0: SELECT TO_DAYS("2017-06-20 09:34:00");
❮ MySQL Functions