Date and time manipulation

Hi All.

I’m learning how to manipulate dates and times and using the code
below came up with time of “12:12:00”.

How do I do this example calculation and return a time of 00:12:00?

$start = ‘2009-08-18 00:02:00’;
$newdatetime = strtotime(‘+10 minute’, strtotime($start));
echo date(‘d-m-y h:i:s’, $newdatetime);

I also need to create a form for a user to easily enter a date and time which defaults to the current date and time. Can anybody point me to an example application that does this.

Is there such thing as a time picker?



A lower case ‘h’ will display the hours using the 12-hour format, so it was actually showing the right time (24-hour 00 == 12-hour 12).

You want ‘d-m-y H:i:s’. More info on

As for datepickers, there are millions. If you’re using jQuery, you might want to investigate jQuery.ui’s datepicker. Otherwise try googling javascript date pickers and choose one you like :wink: