add datetime in table mysql code example
Example 1: how to add timestamp column in mysql
ALTER TABLE `table1` ADD `lastUpdated` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;
Example 2: mysql insert datetime
-- If you just need to insert the current DateTime: --
INSERT INTO yourtable (`DateTimeFieldName`) VALUES (NOW());