Location: PHPKode > scripts > Date difference > date-difference/date_difference_class.php
<?php
class date_difference
{
public $date1, $date2, $a, $days, $hours, $minutes, $seconds;

function __construct($date_, $date__)
{
$this->date1 = $date_;
$this->date2 = $date__;
$this->days = intval((strtotime($this->date1) - strtotime($this->date2)) / 86400);
$this->a = ((strtotime($this->date1) - strtotime($this->date2))) % 86400;
$this->hours = intval(($this->a) / 3600);
$this->a = ($this->a) % 3600;
$this->minutes = intval(($this->a) / 60);
$this->a = ($this->a) % 60;
$this->seconds = $this->a;
}
}
?>
Return current item: Date difference