how can i insert the current server time into a TIMESTAMP field automaticaly?
and which is better to use? DATETIME or TIMESTAMP?
I've got a timestamp(12) field in a mysql table and I populateit with PHP's now() function. When I takea peek at the contents of the table, all of the timestamps are different, but when I use date() on them, I always get January 18, 2038. Crazy.
doublepost
Use time() function. E.g.
$time_right_now = time();
This will always return the current date and time in the Unix timestamp format.
To turn this into a date/time format, use the date() function. E.g.
$todays_date = date("d/m/Y", $time_right_now);