mysql insert date
snippet in sql

mysql insert datetime

user2836

-- If you just need to insert the current DateTime: --
INSERT INTO yourtable (`DateTimeFieldName`) VALUES (NOW());

how to assign date field for table in mysql

user2849


        
            
        
     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
);

mysql insert date

user1765

INSERT INTO custorder 
  VALUES ('Kevin', 'yes' , STR_TO_DATE('1-01-2012', '%d-%m-%Y') ) ;
                        ^                                     ^
---parenthesis removed--|                and added here ------|