FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16352&edit=1

ID: 16352
Updated by: daniel.oconnor@gmail.com
Reported By: tomasm2005 at gmail dot com
Summary: Inconsistent time conversion on window and linux with
DST
-Status: Open
+Status: Feedback
Type: Bug
Package: Date
Operating System: Windows / Linux
Package Version: Unknown
PHP Version: 5.2.9
Roadmap Versions:
New Comment:

-Status: Open
+Status: Feedback
What's your local timezone?
How recent is your timezone database? (phpinfo()?)


http://pecl.php.net/package/timezonedb/


Previous Comments:
------------------------------------------------------------------------

[2009-06-20 07:45:55] tomasm2005

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)

------------------------------------------------------------------------

Search Discussions

  • Tomasm2005 at Jun 20, 2009 at 2:16 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=16352&edit=1

    ID: 16352
    Updated by: tomasm2005@gmail.com
    Reported By: tomasm2005 at gmail dot com
    Summary: Inconsistent time conversion on window and linux with
    DST
    Status: Feedback
    Type: Bug
    Package: Date
    Operating System: Windows / Linux
    Package Version: Unknown
    PHP Version: 5.2.9
    Roadmap Versions:
    New Comment:

    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


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-06-20 16:10:34] doconnor

    -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 07:45:55] tomasm2005

    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)

    ------------------------------------------------------------------------
  • Tomasm2005 at Jun 20, 2009 at 2:17 pm
    Edit report at http://pear.php.net/bugs/bug.php?id=16352&edit=1

    ID: 16352
    Comment by: tomasm2005@gmail.com
    Reported By: tomasm2005 at gmail dot com
    Summary: Inconsistent time conversion on window and linux with
    DST
    Status: Feedback
    Type: Bug
    Package: Date
    Operating System: Windows / Linux
    Package Version: Unknown
    PHP Version: 5.2.9
    Roadmap Versions:
    New Comment:

    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?


    Previous Comments:
    ------------------------------------------------------------------------

    [2009-06-20 16:14:20] tomasm2005

    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 16:10:34] doconnor

    -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 07:45:55] tomasm2005

    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)

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 20, '09 at 2:12p
activeJun 20, '09 at 2:17p
posts3
users3
websitepear.php.net

People

Translate

site design / logo © 2022 Grokbase