Reputation: 863
How do I create a unix timestamp in MySQL? I know the type is set to INT and value is NULL but I need it to populate with current time in the format like: 1343782742
INT
NULL
Upvotes: 4
Views: 11764
Reputation: 263893
use UNIX_TIMESTAMP(date)
UNIX_TIMESTAMP(date)
SELECT UNIX_TIMESTAMP(NOW())
SQLFiddle Demo
UNIX_TIMESTAMP
Upvotes: 9