0

Thanks, but it is not what i was expecting. I
I am getting close but i still have a problem
let's say

$reminder ="300"; // 5 minutes * 60 seconds (to convert to seconds) 
$timefromreminder = date('h:i:s', strtotime("-$reminder seconds")); 
// this will give 5 minutes minus the current time 
//but what i am looking for is to be able to do this 
$event_start_time = '11:45:00';
 $timefromreminder2 = date('$event_start_time', strtotime("-$reminder seconds")); 
//Now it does not give 11:40:00 instead it does nothing and gives the same 11:45:00

I want to be able to delete 5 minutes from a time i specify

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by vibhaJ
1

This code will generate your requires output.

<?	
	$reminder ="300"; // 5 minutes * 60 seconds (to convert to seconds) 
	$timefromreminder = date('h:i:s', strtotime("-$reminder seconds")); 
	// this will give 5 minutes minus the current time 
	//but what i am looking for is to be able to do this 
	
	$event_start_time = '11:45:00';
	echo '<br />Start Time : '.date('H:i:s',strtotime($event_start_time)); 
	echo '<br />End Time : '.date('H:i:s', strtotime("-$reminder seconds",strtotime($event_start_time))); 
	exit;	

?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.