views:

95

answers:

2

How can I show a date popup box that formats the date so it will fit in the mySQL date field?

Also, how can I check or format time to fit in the mySQL time field?

+7  A: 
$mysqldate = date( 'Y-m-d H:i:s', $phpdate );
$phpdate = strtotime( $mysqldate );

edit:

This and Everything else about date/time in PHP, and how to use it with MySQL, is in the wonderfull PHP documentation:

http://be.php.net/datetime

Ward Werbrouck
+1  A: 

It sounds like you're looking for some kind of widget to allow the user to enter date & time. See this stack overflow thread.

Boden