Christian Seiler: falscher days-Wert bei DateTime::diff

Beitrag lesen

Hallo,

kann mir jemand erklären, warum mir
  ~~~php

$datenow  = new DateTime('2009-12-21 12:00:00');

$datethen = new DateTime('2009-12-20 12:00:00');
  $datediff = $datenow->diff($datethen);
  print_r($datediff);


> auf meinem lokalen Testsystem (Win 7, PHP 5.3.0) folgendes ausgibt?  
>   
> DateInterval Object  
> (  
>     [y] => 0  
>     [m] => 0  
>     [d] => 1  
>     [h] => 0  
>     [i] => 0  
>     [s] => 0  
>     [invert] => 1  
>     [days] => 6015  
> )  
>   
> d = 1, passt.  
> Aber warum days = 6015?  
  
Kannst Du bitte mal die Ausgabe von  
  
print\_r($datenow);  
print\_r($datethen);  
  
auf Deinem System, wo der Fehler auftritt, posten?  
  
Viele Grüße,  
Christian  

-- 
[Mein "Weblog"](http://del.icio.us/chris_se/servertipps) [[RSS](http://del.icio.us/rss/chris_se/servertipps)]  
[Using XSLT to create JSON output](http://www.christian-seiler.de/projekte/xslt-json/) (Saxon-B 9.0 for Java)  
  
»I don't believe you can call yourself a web developer until you've built an app that uses hyperlinks for deletion and have all your data deleted by a search bot.«  
            -- [Kommentar bei TDWTF](http://thedailywtf.com/Comments/WellIntentioned-Destruction.aspx#254549)