When we create MySQL table, we usually add column insert_timestamp and update_timestamp to save insert time and update time, we can set update_timestamp DEFAULT CURRENT_TIMESTAMP, make update_timestamp update timestamp as soon as update a row, but how to set insert_time with the time when it inserted?
You can do that passing it throught your Insert Query like this:
Where insertTime will be replaced by your local time. The other option is to create a before_insert trigger for your table, for example:
See: https://dev.mysql.com/doc/refman/5.0/en/trigger-syntax.html, http://dev.mysql.com/doc/refman/5.6/en/insert.html