DateTime

The proper way to format the current time for a mysql datetime field using php:

$datetime = date('Y-m-d G:i:s',time());

Or, using the mysql query to do it for you:

INSERT INTO my_table (field_name) VALUES (NOW());

Leave a Reply

date Apr 29th 2011
author Mike
category Geek
tags,
  View Comments