Answers for "how to find time interval betweeen 2 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

Browse Popular Code Answers by Language