Quickly converting a MySQL timestamp to a Unix Timestamp
Posted 5 April 2004
A commonly asked question is converting MySQL timestamps into unix timestamps. Although it’s usually easiest to do this on the mysql server with UNIX_TIMESTAMP(), you can achieve the same thing with this function.
A quick example:
This would output:
MySQL Datetime: 20090408234019.000000
Unix Timestamp: 1239198019
Unix Timestamp, from MySQL: 1239198019