date/time add question

I have a date string and time string passed from a form field. I need to combine those two elements into a datetime variable, then add a time variable that is pulled as a string from an xml file. I can not seem to get the correct format for a simple addition to yeild the proper result.
The time is formatted as H:i for all objects concerned in this example.

For example:
[php]
$xml = simplexml_load_file("…/xml/my_tasks.xml");
$startdate = $_POST[‘startdate’];
$starttime = $_POST[‘starttime’];
$duration = $xml->task[0]->duration;
[/php]

So, I want to make $startdate and $starttime into something like : ‘2012-01-17 23:30’, and then add $duration, which would be something like ‘1:00’, which should yeild a result of ‘2012-01-18 00:30’ .

I have tried multiple variations but need help getting the correct way to do this.

thanks.

Sponsor our Newsletter | Privacy Policy | Terms of Service