BarclayVision
BarclayVision

Reputation: 863

Create Unix Timestamp in MySQL

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

Upvotes: 4

Views: 11764

Answers (1)

John Woo
John Woo

Reputation: 263893

use UNIX_TIMESTAMP(date)

SELECT UNIX_TIMESTAMP(NOW())

Upvotes: 9

Related Questions