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

Bug #18368 compare() modifies Objects
Submitted: 2011-03-17 19:18 UTC
From: ernst Assigned:
Status: Open Package: Date (version 1.4.7)
PHP Version: 5.2.12 OS: Windows 7
Roadmaps: (Not assigned)    
Subscription  


 [2011-03-17 19:18 UTC] ernst (Ernst Hansmair)
Description: ------------ The method compare($a,$b) normalizes the time zone to UTC before comparing. This should not be done on the operands, but on clones of the operands. Problem exists, if a time zone other than UTC is used. I am using the Date in time zone CEST. A Date of 2011-01-01 00:00:00 is modified to 2010-12-31 23:00:00 Test script: --------------- $a = new Date( '2011-01-01' ); print 'before: ' . $a->year; $res = $a->compare( new Date('2011-01-01'); print 'after: ' . $a->year; Expected result: ---------------- before: 2011 after: 2010

Comments