Im using a JQuery Datepicker (datetimepicker actually) and would like the date (and time) to appear in a user friendly way such as = 01/02/2011 20:30 on the page when the user has selected their date and time, but then be able to insert it into my database as MYSQL DATETIME ( 2011-02-01 20:30 ).
I’ve had a good luck around but it seems most people want to do the reverse of what i want.
Anybody got any ideas?
Quick and dirty:
This uses PHP’s built-in wrapper around
strtotime()to parse the date expression into a Unix timestamp, then re-format it in a way that MySQL can handle.