UNIX_TIMESTAMP()
UNIX_TIMESTAMP([datetime])This function returns the number of seconds since the start of the Unix epoch (January 1, 1970, Greenwich Mean Time). Without a given time, this function will return the Unix time for the current date and time. Optionally, a date and time value (directly or by way of a column value) may be given for conversion to Unix time with this function. Here is an example:
SELECT UNIX_TIMESTAMP( ) AS 'Now',
UNIX_TIMESTAMP('2008-05-09 20:45:00') AS 'Same Time from String';
+------------+-----------------------+
| Now | Same Time from String |
+------------+-----------------------+
| 1210383900 | 1210383900 |
+------------+-----------------------+The first column uses the function to determine the Unix time for the moment that the statement was entered. The second column uses the same function to determine the Unix time for the same date and time provided in a common, readable format.