Answers for "calculate time interval between two dates"

PHP
2

Interval Between Different Dates

$datetime1 = new DateTime('2009-10-11 12:12:00');
$datetime2 = new DateTime('2009-10-13 10:12:00');

$interval = $datetime1->diff($datetime2);
echo $interval->format('%Y-%m-%d %H:%i:%s');
Posted by: Guest on February-24-2021

Code answers related to "calculate time interval between two dates"

Browse Popular Code Answers by Language