...

View Full Version : Date



niko
04-22-2004, 03:41 PM
What is the best way to insert a date field into a mysql database through PHP,

ive tried DATE()

and <?php echo date("j/n/y h:i a");?>

however sometimes these dont work right.

sad69
04-22-2004, 06:17 PM
Check this out:
http://www.tek-tips.com/gviewthread.cfm/pid/434/qid/808535

Sadiq.

SDP2006
04-22-2004, 09:16 PM
I think MySQL has a TIMESTAMP field type.

http://dev.mysql.com/doc/mysql/en/DATETIME.html

sidney
04-22-2004, 11:26 PM
if you want the date time at the time of inserting try now()



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum