Hello just a simple question here. Php's time related functions are confusing me ;-(
Given 2 variables
$start = "2013-07-25 20:24:13" ('Y-m-d H:i:s');
$duration = "0:55" ('H:i');
How may I add $duration
to $start
? should result in:
"2013-07-25 21:19:13"
$start = strtotime($start); $duration = explode(':', $duration); $end = date("Y-m-d H:i:s", strtotime('+'.$duration[0].' hour '.$duration[1].' minutes', $start));
– TNT_Larsn Aug 23 '13 at 05:25