[eluser]Hartimer[/eluser]
Ok, it was tough but finally i figured it out.
I was trying precisely the same thing, using some date/time function to send to a MySQL query, which contained a DATETIME field.
The function now() (which exists after loading the date_helper btw) returns the info in UNIX format...
So the logical thing to do would be to use the function unix_to_human (which exists in the same helper).
Even with this the date was not being inserted on my database... all fields were being filled with "0000-00-00 ...".
My problem was the date format. I'm european so, to insert the data i had to use
Code:
unix_to_human(now(), TRUE, "eu");
Another thing, it worked just fine on the fly..
Code:
<?=form_open('comments/new_comment')?>
Comment: <?=form_textarea("body")?><br />
<?=form_hidden("date", unix_to_human(now(), TRUE, "eu"))?>
<?=form_submit('', "Send comment")?>
<?=form_close()?>
Hope this helps someone