To convert a date in the format YYYY-MM-DD HH:MM:SS to a purely numeric date (i.e., a timestamp), you need to use the MySQL function UNIX_TIMESTAMP.
Example:
SELECT UNIX_TIMESTAMP('2017-05-22 14:20:05') `new_date`Result — 1495452005
The same query, but without the time part:
SELECT UNIX_TIMESTAMP('2017-05-22') `new_date`Result — 1495400400
