How to get Diference Between 2 time stamps in minutes

 

$startdate_time='13-05-2023 9:00';
$enddate_time='13-05-2023 9:30';
$start_timestamp=strtotime($startdate_time);

$end_timestamp=strtotime($enddate_time);


$minutes_diff= round(abs($end_timestamp- $start_timestamp) / 60,2);

echo $minutes_diff. " minutes ";

Output : 30 minutes

See All answers


  1. $time1='15-05-2022 9:00';
    $time2='15-05-2022 9:30';
    $start_timestamp=strtotime($time1);

    $end_timestamp=strtotime($time2);

    $minutes_diff= round(abs($end_timestamp- $start_timestamp) / 60,2);

    echo $minutes_diff. " minutes DIference between two dates ";

    Output : 30 minutes minutes DIference between two dates

My Thought

Your email address will not be published. Required fields are marked *

Our Tool : hike percentage calculator