Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0a4

Bug #18942 DateDiff calculation error
Submitted: 2011-10-29 14:54 UTC
From: cmodijk Assigned:
Status: Open Package: Date (version Unknown)
PHP Version: 5.2.12 OS: CentOS
Roadmaps: (Not assigned)    
Subscription  


 [2011-10-29 14:54 UTC] cmodijk (Cliff Secret)
Description: ------------ The date diff gives a wrong day count. When coming from 2011-10-01 to 2011-11-01 it gives 32 days While if you diff 2011-08-01 to 2011-09-01 it gives 31 days Test script: --------------- $begin = new Date("2011-10-01"); $eind = new Date("2011-11-01"); echo $aantalDagen = ceil($eind->dateDiff($begin)); // 32 # Needs to be 31 $begin = new Date("2011-08-01"); $eind = new Date("2011-09-01"); echo $aantalDagen = ceil($eind->dateDiff($begin));>dateDiff($begin)); // 31 # Expected Expected result: ---------------- Expexted to get 31 in both cases Actual result: -------------- Got 32 an 31

Comments