Hello guys im having trouble adding 2 hours to the current time in php its not working and i dont understand why? :/ is the code wrong? please help here is the code
PHP Code:
//current time was 12:28pm $extra1 = time() + 7200; $timet2 = date('H:m:s',$extra1);
echo "time 2 ".$timet2."<br/>";// the output was 14:01:15 when its supposed to be 2 hours later
if($values['chapel'] == 'Yes' && $assign == '0'){
$strSQLInsert = "insert into alert (`case_no`,`deceased_name`,`date`,`time`,`task`,`counselor`,`status`) values ('".$values['case_no']."','".$values['deceased_name']."','".$cdate."','".$timet2."','find_chapel','".$values['counselor']."','Active')"; db_exec($strSQLInsert,$conn);
} //current time was 12:28 pm $extra2 = time() + 8100; $timet3 = date('H:m:s',$extra2);
echo "time 3 ".$timet3."<br/>";// output was 14:01:15 when it was supposed to be 2 hours and 15 min later
im going crazy now!! when i run the code it was 13:01:00 the output was 15:01:00 when i refresh the page 5 min later it keeps giving me the same current time 13:01:00 even thought it is 15:06:00 :S