how to use date to insert date and time in mysql code example
Example 1: mysql insert datetime
-- If you just need to insert the current DateTime: --
INSERT INTO yourtable (`DateTimeFieldName`) VALUES (NOW());
Example 2: how to assign date field for table in mysql
CREATE TABLE people (
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
birth_date DATE NOT NULL
);