I have two dates,
$expiry_time = strtotime('comming from database');
$current_date = strtotime(date('Y-m-d H:i:s'));
$time_diff = ($expiry_time-$current_date)/(3600);
Here, $time_diff
will give me difference in hours. eg. 5.67. But, I want it in hours, minute and second format. How can I achieve this?
Thanks.
Use
DateTime()
withDateInterval()