UNIX_TIMESTAMP
UNIX_TIMESTAMP()
In PHP we can get use time() function for getting unix timestamp. In mysql we can use unix_timestamp function for the same.If we pass an out-of-range date to UNIX_TIMESTAMP(), it returns 0.Without arguments does return the unix timestamp for the current time.
Syntax:
UNIX_TIMESTAMP([timestamp]);
Example :
SELECT UNIX_TIMESTAMP();
UNIX_TIMESTAMP(’2004-10-31 01:52:37′);
Output :
1170925939
1099167757
