Hallo,
ich brauch mal Eure Hilfe...
Folgendes einfaches Script ergibt unverständlicherweise 0 anstatt der erwarteten 1.
$date1=date_create("2016-02-01"); $date2=date_create("2016-03-01"); $diff=date_diff($date1,$date2,true); echo $diff->format("%m");
Wenn ich bei $date2 anstelle vom März den April eintrage, dann wird korrekt "2" ausgegeben.
Hat jemand eine Erklärung?
guckst Du Warnungen:
0PHP Warning: date_create(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Paris' for '2.0/DST'
date_default_timezone_set('Europe/Paris'); // Warnung weg, Ergebnis immer noch 0 aber besser zu sehen
--
Schneckentempo? Läuft denen auch die Nase?
Schneckentempo? Läuft denen auch die Nase?