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

Bug #16574 inDaylightTime fails for southern hemisphere DST
Submitted: 2009-09-07 15:41 UTC
From: morloch Assigned:
Status: Open Package: Date (version 1.5.0a1)
PHP Version: 5.2.1 OS: NA
Roadmaps: (Not assigned)    
Subscription  


 [2009-09-07 15:41 UTC] morloch (David Mohr)
Description: ------------ For a date and time that is definitely in a valid daylight savings period, the inDaylightTime function incorrectly reports that the given time is not DST. The logic on lines 761 and 762 appears to be at fault, it should be a logical OR, not AND. Test script: --------------- <?php require_once 'Date.php'; $now = new Date("2008-01-11 10:00:00"); $defaultZone = new Date_TimeZone('Australia/Sydney'); echo $defaultZone->getID() . "\n"; var_dump($defaultZone->inDaylightTime($now)); echo $now->format('%Y-%m-%d %H:%M:%S%O') . "\n"; ?> Expected result: ---------------- Australia/ACT bool(true) 2008-01-11 10:00:00+11:00 Actual result: -------------- Australia/ACT bool(false) 2008-01-11 10:00:00+10:00

Comments

 [2009-12-29 01:08 UTC] cniccolo (Niccolo Camponovo)