Calculate unix timestamp in mysql
by Ramya[ Edit ] 2008-07-29 20:53:18
Unix Timestamp:
To calculate date/time in unix timestamp in mysql,
mysql> SELECT UNIX_TIMESTAMP();
It results,
UNIX_TIMESTAMP()
1217344347
It will display the unix timestamp value for the current date/time.
To convert the given date/time to unix timestamp,
In mysql prompt type,
mysql> SELECT UNIX_TIMESTAMP('2008-05-22 05:25:45');
It results,
UNIX_TIMESTAMP('2008-05-22 05:25:45')
1211414145