How mysql to_days after the date back into the number of days to a date?

I met a demand, the date for the combined data of the day, it needs to be changed to the date of day, number of days and then they changed the date to see whether the same date;

Use the mysql to_days (date) Date Type Can be converted to a numeric type 

select to_days(now())
737025

Then use from_days (to_days (date)) function of the number of days and then converted to date on the line

FROM_DAYS the SELECT (TO_DAYS (now ()))
2017-11-27
then from_days (to_days (date)) function of the number of days and then converted to date on the line

Published 479 original articles · won praise 72 · views 410 000 +

Guess you like

Origin blog.csdn.net/w892824196/article/details/104262646