Reputation: 1477
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?
Upvotes: 1
Views: 1013
Reputation: 1462
$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 wonderful PHP documentation:
Upvotes: 6
Reputation: 4167
It sounds like you're looking for some kind of widget to allow the user to enter date & time. See this stack overflow thread.
Upvotes: 1