I made a table in mysql, with for example date_birth date ;
and then tried to insert a date like this in it date('Y-m-d H:i:s') but the inserted date is like this format 2012-08-02, so do you know what’s wrong? or maybe for long format of date is shouldn’t use date in mysql ?
thanks!!
Alter your mysql table with
date_birth DATETIMEinstead ofdate_birth DATEYou can do this with below query:
ALTER TABLE table_name MODIFY COLUMN date_birth DATETIMEand then if you insert date like
date('Y-m-d H:i:s')it will take full date time not just date