Skip to main content

Creating a Unix timestamp for the current timestamp:

SELECT TIMESTAMPDIFF(SQL_TSI_SECOND, FROM_UNIXTIME(0), NOW());;

 

Creating a Unix timestamp for any given date or timestamp:

 

SELECT TIMESTAMPDIFF(SQL_TSI_SECOND, FROM_UNIXTIME(0), mydateOrTimestamp);;

Be the first to reply!

Reply