downoad
result().' '; $diff=new day_difference('1000-01-01T15:19:21+00:00','1100-01-01T15:19:21+00:00',new DateTimeZone('Europe/Berlin')); echo $diff->result().' ';; // Geht auch negativ, d.h. wieviele tage sind vergangen $diff=new day_difference('Fri, 22 Dec 2000 16:01:07 +0200','Thu, 21 Dec 2000 16:01:07 +0200',new DateTimeZone('Europe/Berlin')); echo $diff->result(); class day_difference { protected $startdate; protected $enddate; protected $result; public function __construct($startdate,$enddate,datetimezone $datetimezone=NULL) { $this->startdate=new DateTime($startdate,$datetimezone); $this->enddate=new DateTime($enddate,$datetimezone); } public function result() { if(isset($this->result)) return $this->result; $this->result=($this->enddate->format('z')+1)-($this->startdate->format('z')+1); if($this->startdate->format('Y')!==$this->enddate->format('Y')) { $yeardifference=$this->enddate->format('Y')-$this->startdate->format('Y'); $this->result+=$yeardifference*365; } return $this->result; } } ?>
brauchen wir ein download portal ?
