I am trying to write a code in php where I retrieve the DateTime from the database and find what time is it 15 minutes before the DateTime.
//Receiving the Start Time from the database. $time1 = "2012-03-17 15:00:00"; //Reformating time to get the date 1hr or 1min or 15mins before Start Time. $reminder = date("g:i", strtotime("-15 minutes", $time1)); //Print echo $reminder;
But the only problem with the concept I have above is it prints out 7:00:09.
Can any one help me solve this issue please and thank you.