#40340 [NEW]: Creating a DateTime object using a string that is invalid due to DST transition

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40340 [NEW]: Creating a DateTime object using a string that is invalid due to DST transition

    From: kal at kalunite dot net
    Operating system: Linux
    PHP version: 5.2.0
    PHP Bug Type: Date/time related
    Bug description: Creating a DateTime object using a string that is invalid due to DST transition

    Description:
    ------------
    You can create an invalid DateTime object by giving it a string in the GNU
    Date Input Format syntax.

    For instance, '2006-04-02 02:05:00 America/New_York' is supposed to be
    invalid because DST takes effect on that day, such that all times >=
    02:00:00 and < 03:00:00 are supposed to be invalid. Trying to create a
    DateTime object with that string is supposed to return FALSE.

    The bug is probably not caused by an outdated timezone database because
    the timezone database in use is version 2006.14.

    I could not test for the bug in the latest snapshot because the latest
    snapshot crashes Apache2 on my machine( and that's a different story).

    Reproduce code:
    ---------------
    <?
    $foo = date_create('2006-04-02 02:05:00 America/New_York');
    if($foo)
    {
    echo $foo->format('Y-m-d H:i:s e'),$foo->format('I')?' DST':'';
    }
    else
    {
    echo "FALSE";
    }
    ?>

    Expected result:
    ----------------
    FALSE

    Actual result:
    --------------
    2006-04-02 02:05:00 America/New_York DST

    --
    Edit bug report at [url]http://bugs.php.net/?id=40340&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40340&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40340&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40340&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40340&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40340&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40340&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40340&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40340&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40340&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40340&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40340&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40340&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40340&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40340&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40340&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40340&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40340&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40340&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40340&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40340&r=mysqlcfg[/url]
    kal at kalunite dot net Guest

  2. Similar Questions and Discussions

    1. Creating a small transition video 100px
      Hi, I'm not sure if this is the appropriate flash thread to start here but since it's listed under Media I thought I'd stick it under this...
    2. How to insert Transition object into html document
      Hello Friends, I am trying to insert Transition object ( downloaded from Extension) into HTML document. I tried Insert -> HTML -> Head Tags ->...
    3. Invalid datetime format
      After upgrading from CF4 to CFMX7 we are getting this error on any date field that we're trying to pull in a query. Error Executing Database...
    4. Server object, ASP 0177 (0x800401F3) Invalid Class String
      First of all, I have read all of the solutions I could possibly find for this issue. Secondly, none of them work for me. I am using: WinXP Pro...
    5. Need help creating a fade transition in Lingo
      Does anyone know how to create a "fade" transition using Director 7's (or MX's) Lingo? I know how to fade in individual sprites using Lingo, but...
  3. #2

    Default #40340 [Opn->Asn]: Creating a DateTime object using a string that is invalid due to DST transition

    ID: 40340
    Updated by: [email]derick@php.net[/email]
    Reported By: kal at kalunite dot net
    -Status: Open
    +Status: Assigned
    Bug Type: Date/time related
    Operating System: Linux
    PHP Version: 5.2.0
    -Assigned To:
    +Assigned To: derick


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

    [2007-02-03 04:27:27] kal at kalunite dot net

    Description:
    ------------
    You can create an invalid DateTime object by giving it a string in the
    GNU Date Input Format syntax.

    For instance, '2006-04-02 02:05:00 America/New_York' is supposed to be
    invalid because DST takes effect on that day, such that all times >=
    02:00:00 and < 03:00:00 are supposed to be invalid. Trying to create a
    DateTime object with that string is supposed to return FALSE.

    The bug is probably not caused by an outdated timezone database because
    the timezone database in use is version 2006.14.

    I could not test for the bug in the latest snapshot because the latest
    snapshot crashes Apache2 on my machine( and that's a different story).

    Reproduce code:
    ---------------
    <?
    $foo = date_create('2006-04-02 02:05:00 America/New_York');
    if($foo)
    {
    echo $foo->format('Y-m-d H:i:s e'),$foo->format('I')?' DST':'';
    }
    else
    {
    echo "FALSE";
    }
    ?>

    Expected result:
    ----------------
    FALSE

    Actual result:
    --------------
    2006-04-02 02:05:00 America/New_York DST


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


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40340&edit=1[/url]
    derick@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139