Answers for "Interval Between Different 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 "Interval Between Different Dates"

Browse Popular Code Answers by Language