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

Bug #16352 Inconsistent time conversion on window and linux with DST
Submitted: 2009-06-20 11:45 UTC
From: tomasm2005 Assigned:
Status: Open Package: Date (version Unknown)
PHP Version: 5.2.9 OS: Windows / Linux
Roadmaps: (Not assigned)    
Subscription  


 [2009-06-20 11:45 UTC] tomasm2005 (Thomas Antony)
Description: ------------ While converting times from Los Angeles time to New Zealand time, if I use the time zone as 'New Zealand Standard Time', on Windows, DST is taken into account while on Linux, DST is not taken into account. The bug disappears if the Date object is created as $d = new Date(strtotime($date)); rather than $d = new Date($date); with the date being given in the format YYYY-MM-DD HH:MM:SS Test script: --------------- http://pastebin.com/f5f2bd39e Expected result: ---------------- Using New Zealand Standard Time : 2009-06-17 18:40:51 Using NZ : 2009-06-17 18:40:51 Actual result: -------------- Using New Zealand Standard Time : 2009-06-17 19:40:51 Using NZ : 2009-06-17 18:40:51 ( on linux)

Comments

 [2009-06-20 20:10 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Feedback
What's your local timezone? How recent is your timezone database? (phpinfo()?) http://pecl.php.net/package/timezonedb/
 [2009-06-20 20:14 UTC] tomasm2005 (Thomas Antony)
On my local system,. the timezone is Indian Standard Time. On the linux server on the webhost, phpinfo() gives the "Default Timezone" under the heading "date" as America/Halifax
 [2009-06-20 20:16 UTC] tomasm2005 (Thomas Antony)
On the server the version is : "Olson" Timezone Database Version 2009.1 On my local system it is: "Olson" Timezone Database Version 2008.9 Is that what you meant?
 [2012-01-27 19:40 UTC] doconnor (Daniel O'Connor)
-Status: Feedback +Status: Open