Is there any native function for getting the difference between two timestamps? I want to get minutes difference of two timestamps.
Edit: Sorry but actually I just want the difference of two Unix timestamp.
$date = new DateTime();
$date1_timestamp = $date->getTimestamp();
sleep('120');
$date2_timestamp = $date->getTimestamp();
function get_unix_timestamp_minutes_difference($start, $end) {
/*
Some code for return the difference between two unix timestamps
*/
}
echo get_timestamp_minutes_difference($date1_timestamp, $date2_timestamp);