Von
Von

Reputation: 304

Mysql row insert time

How to get insert time of rows in mysql without using time-stamp in columns? Or is it possible of getting each row creation/insertion time in mysql ? If yes , Please let me know.

Upvotes: 3

Views: 2262

Answers (1)

pavel
pavel

Reputation: 27092

MySQL has function NOW() or synonymous CURRENT_TIMESTAMP() which contains current datetime.

Ex.

INSERT INTO `table` (`col1`, `col2`, `created`) VALUES ('val1', 'val2', NOW())

Without this column there is no chance to get a time when the record was created.

Upvotes: 3

Related Questions