<?php
$date_a = new DateTime('2013-10-25 17:10:30');
$date_b = new DateTime('2010-06-13 01:42:05');
$interval = date_diff($date_a,$date_b);
echo 'The below format is in Y:m:d H:i:s'."<br>";
echo $interval->format('%Y:%m:%d %H:%i:%s');
?>
$date_a = new DateTime('2013-10-25 17:10:30');
$date_b = new DateTime('2010-06-13 01:42:05');
$interval = date_diff($date_a,$date_b);
echo 'The below format is in Y:m:d H:i:s'."<br>";
echo $interval->format('%Y:%m:%d %H:%i:%s');
?>
No comments:
Post a Comment