I. This is a limitation on MySQL. If you are viewing the application, you can add a time () call to the created_at column, and let the updated_at column use CURRENT_TIMESTAMP.
$sql = "INSERT INTO my_table SET name = 'Mike', created_at = " . time();
I would prefer to do this in the created_at column, since it probably won't be affected as often as the updated_at column.
- Change -
Better yet, use MySQL built into the now() function. Thus, you only need to consider the time zone of the mysql server and not the time zones of the application server and mysql server.
$sql = "INSERT INTO my_table SET name = 'Mike', created_at = NOW()";
source share