2012-07-12 41 views

回答

1
<?php 
$arrival_time="7.30 AM"; 
$departure_time="8.30 PM"; 

$d1= strtotime($arrival_time); 
$d2= strtotime($departure_time); 

$diff=$d2-$d1; 

//Print the difference in hours : minutes 
echo date("H:i",$diff); 
?> 
0
<?php 
$am = "7:30AM"; 
$pm = "8:30PM"; 
$minutes_diff = round(abs(strtotime($pm) - strtotime($am))/60);