I have this MySQL query:
$SQLquery = "INSERT INTO `experimental`.`comments` (`comment_id`, `comment_dt`)
VALUES (NULL, CURRENT_TIMESTAMP);";
When I execute this line with PHP into the MySQL Database at comment_dt row appears my computer local time and date. Does anybody know how to set to appear in my database a server local and time date?
The best way will be that you should make your
comment_dtcolumnDATETIMEtype and set default valueCURRENT_TIMESTAMP. No need to manually insert it through insert query.Using this each time your
comment_dtwill be automatically updated with server date-time whenever a new row inserted.