Answers for "calculate the difference between two dates in minutes"

PHP
9

How to calculate the difference between two dates

$datetime1 	= new DateTime('2020-10-11 16:52:52');
$datetime2 	= new DateTime('2020-10-13 16:52:52');
$interval 	= $datetime1->diff($datetime2);

echo $interval->format('%a days');
Posted by: Guest on June-26-2020
0

find difference between times in minutes

var mins = moment.utc(moment(endTime, "HH:mm:ss").diff(moment(startTime, "HH:mm:ss"))).format("mm")
Posted by: Guest on May-01-2022

Code answers related to "calculate the difference between two dates in minutes"

Browse Popular Code Answers by Language