(1-1/1)
Try using the TIMESTAMP column type instead of DATETIME. I ran into the same issues, and TIMESTAMP seems to work perfect.
TIMESTAMP's default format:
YYYY-MM-DD HH:MM:SS
With MySQL (not sure about others) you can set the column to have a default value of current_TIMESTAMP without having any PHP telling it to do so (this can only be done with TIMESTAMP).
(1-1/1)
June 27 2010
December 20, 2010 00:00
Subject: Insert now() to the datetime column
table:
users (id int, name varchar(10),created datetime);
I need this query:
insert into users(id,name,created) values(id,'test',now());
How i can tell model that field 'created' is datetime and to insert directly now() or to make function on_insert that can do this?