views:

61

answers:

1

I'm using the Martin Milesich TimePicker, which is basically the jUI datepicker with hour/minute sliders attached to it.

I have a couple of queries regarding this:

1) I'm storing the data in a database field of type DATETIME - as you're probably aware the default format for this field is 2010-07-19 14:00:00. In my form field however I am displaying the date/time in a more friendly way, i.e. 19/07/2010 14:00 (uk format). So how can I convert my friendly format into the MySQL format after posting the form?

2) Optionally, is it possible for the time portion to be inputted in to its own field? I looked in the timepicker.js file and noticed a setting 'altTimeField' - which it says is a 'Selector for an alternate field to store time into' but so far I have not been able to get this to work.

Thanks.

A: 
$mydatetime=date('Y-m-d H:i:s', strtotime($mydatetime));
GSTAR