Professional Web Applications Themes

#39026 [NEW]: strtotime("060901") does not produce a correct date stamp for 2006-09-01 - PHP Bugs

From: dbrong at gmail dot com Operating system: Windows 2000 PHP version: 5CVS-2006-10-03 (snap) PHP Bug Type: Date/time related Bug description: strtotime("060901") does not produce a correct date stamp for 2006-09-01 Description: ------------ I was using date("Y-m-d", strtotime("060901")) to produce a date formatted as "2006-09-01" and this does not work anymore in the latest PHP 5 release. It produces the actual date of the system's current time (2006-10-03 in this case). If I modify it as strtotime("20060901") it works fine. Reproduce code: --------------- date("Y-m-d", strtotime("060901")) will output the current system date (2006-10-03 in this case). Expected result: ---------------- 2006-10-03 (or ...

  1. #1

    Default #39026 [NEW]: strtotime("060901") does not produce a correct date stamp for 2006-09-01

    From: dbrong at gmail dot com
    Operating system: Windows 2000
    PHP version: 5CVS-2006-10-03 (snap)
    PHP Bug Type: Date/time related
    Bug description: strtotime("060901") does not produce a correct date stamp for 2006-09-01

    Description:
    ------------
    I was using date("Y-m-d", strtotime("060901")) to produce a date formatted
    as "2006-09-01" and this does not work anymore in the latest PHP 5 release.
    It produces the actual date of the system's current time (2006-10-03 in
    this case).

    If I modify it as strtotime("20060901") it works fine.

    Reproduce code:
    ---------------
    date("Y-m-d", strtotime("060901")) will output the current system date
    (2006-10-03 in this case).

    Expected result:
    ----------------
    2006-10-03 (or the current date you run the script)

    Actual result:
    --------------
    should be 2006-09-01

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

  2. #2

    Default #39026 [Opn->Asn]: strtotime("060901") does not produce a correct date stamp for 2006-09-01

    ID: 39026
    Updated by: [email]tony2001php.net[/email]
    Reported By: dbrong at gmail dot com
    -Status: Open
    +Status: Assigned
    Bug Type: Date/time related
    Operating System: Windows 2000
    PHP Version: 5CVS-2006-10-03 (snap)
    -Assigned To:
    +Assigned To: derick


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

    [2006-10-03 14:57:38] dbrong at gmail dot com

    Description:
    ------------
    I was using date("Y-m-d", strtotime("060901")) to produce a date
    formatted as "2006-09-01" and this does not work anymore in the latest
    PHP 5 release. It produces the actual date of the system's current
    time (2006-10-03 in this case).

    If I modify it as strtotime("20060901") it works fine.

    Reproduce code:
    ---------------
    date("Y-m-d", strtotime("060901")) will output the current system date
    (2006-10-03 in this case).

    Expected result:
    ----------------
    2006-10-03 (or the current date you run the script)

    Actual result:
    --------------
    should be 2006-09-01


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


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

  3. #3

    Default #39026 [Asn->Bgs]: strtotime("060901") does not produce a correct date stamp for 2006-09-01

    ID: 39026
    Updated by: [email]iliaaphp.net[/email]
    Reported By: dbrong at gmail dot com
    -Status: Assigned
    +Status: Bogus
    Bug Type: Date/time related
    Operating System: Windows 2000
    PHP Version: 5CVS-2006-10-03 (snap)
    Assigned To: derick
    New Comment:

    Thank you for taking the time to write to us, but this is not
    a bug. Please double-check the doentation available at
    [url]http://www.php.net/manual/[/url] and the instructions on how to report
    a bug at [url]http://bugs.php.net/how-to-report.php[/url]

    When you are using 060901 format it is not possible to tell if
    the 2nd 2 characters represent the month or the day of the
    month. In certain locales day comes first in others the month,
    the format is ambiguous.


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

    [2006-10-03 14:57:38] dbrong at gmail dot com

    Description:
    ------------
    I was using date("Y-m-d", strtotime("060901")) to produce a date
    formatted as "2006-09-01" and this does not work anymore in the latest
    PHP 5 release. It produces the actual date of the system's current
    time (2006-10-03 in this case).

    If I modify it as strtotime("20060901") it works fine.

    Reproduce code:
    ---------------
    date("Y-m-d", strtotime("060901")) will output the current system date
    (2006-10-03 in this case).

    Expected result:
    ----------------
    2006-10-03 (or the current date you run the script)

    Actual result:
    --------------
    should be 2006-09-01


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


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

  4. #4

    Default #39026 [Bgs->Asn]: strtotime("060901") does not produce a correct date stamp for 2006-09-01

    ID: 39026
    Updated by: [email]iliaaphp.net[/email]
    Reported By: dbrong at gmail dot com
    -Status: Bogus
    +Status: Assigned
    Bug Type: Date/time related
    Operating System: Windows 2000
    PHP Version: 5CVS-2006-10-03 (snap)
    Assigned To: derick
    New Comment:

    Derick thinks he can fix this :)


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

    [2006-10-05 16:07:43] [email]iliaaphp.net[/email]

    Thank you for taking the time to write to us, but this is not
    a bug. Please double-check the doentation available at
    [url]http://www.php.net/manual/[/url] and the instructions on how to report
    a bug at [url]http://bugs.php.net/how-to-report.php[/url]

    When you are using 060901 format it is not possible to tell if
    the 2nd 2 characters represent the month or the day of the
    month. In certain locales day comes first in others the month,
    the format is ambiguous.

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

    [2006-10-03 14:57:38] dbrong at gmail dot com

    Description:
    ------------
    I was using date("Y-m-d", strtotime("060901")) to produce a date
    formatted as "2006-09-01" and this does not work anymore in the latest
    PHP 5 release. It produces the actual date of the system's current
    time (2006-10-03 in this case).

    If I modify it as strtotime("20060901") it works fine.

    Reproduce code:
    ---------------
    date("Y-m-d", strtotime("060901")) will output the current system date
    (2006-10-03 in this case).

    Expected result:
    ----------------
    2006-10-03 (or the current date you run the script)

    Actual result:
    --------------
    should be 2006-09-01


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


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

  5. #5

    Default #39026 [Asn->WFx]: strtotime("060901") does not produce a correct date stamp for 2006-09-01

    ID: 39026
    Updated by: [email]derickphp.net[/email]
    Reported By: dbrong at gmail dot com
    -Status: Assigned
    +Status: Wont fix
    Bug Type: Date/time related
    Operating System: Windows 2000
    PHP Version: 5CVS-2006-10-03 (snap)
    Assigned To: derick
    New Comment:

    The "[0-9]{6}" was not properly working in PHP 4 and 5.0:

    dericktequila:~$ php-4.4dev -n -r 'echo date("Y m d H:i:s",
    strtotime("990104") ), "\n";'
    1999 01 04 00:00:00
    dericktequila:~$ php-4.4dev -n -r 'echo date("Y m d H:i:s",
    strtotime("980104") ), "\n";'
    1998 01 04 00:00:00
    dericktequila:~$ php-4.4dev -n -r 'echo date("Y m d H:i:s",
    strtotime("000104") ), "\n";'
    2006 10 05 01:04:00
    dericktequila:~$ php-4.4dev -n -r 'echo date("Y m d H:i:s",
    strtotime("010104") ), "\n";'
    2001 01 04 00:00:00
    dericktequila:~$ php-4.4dev -n -r 'echo date("Y m d H:i:s",
    strtotime("020104") ), "\n";'
    2002 01 04 00:00:00

    In PHP 5.1 and up this format is now consitently representing HHMMSS.


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

    [2006-10-05 16:16:46] [email]iliaaphp.net[/email]

    Derick thinks he can fix this :)

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

    [2006-10-05 16:07:43] [email]iliaaphp.net[/email]

    Thank you for taking the time to write to us, but this is not
    a bug. Please double-check the doentation available at
    [url]http://www.php.net/manual/[/url] and the instructions on how to report
    a bug at [url]http://bugs.php.net/how-to-report.php[/url]

    When you are using 060901 format it is not possible to tell if
    the 2nd 2 characters represent the month or the day of the
    month. In certain locales day comes first in others the month,
    the format is ambiguous.

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

    [2006-10-03 14:57:38] dbrong at gmail dot com

    Description:
    ------------
    I was using date("Y-m-d", strtotime("060901")) to produce a date
    formatted as "2006-09-01" and this does not work anymore in the latest
    PHP 5 release. It produces the actual date of the system's current
    time (2006-10-03 in this case).

    If I modify it as strtotime("20060901") it works fine.

    Reproduce code:
    ---------------
    date("Y-m-d", strtotime("060901")) will output the current system date
    (2006-10-03 in this case).

    Expected result:
    ----------------
    2006-10-03 (or the current date you run the script)

    Actual result:
    --------------
    should be 2006-09-01


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


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

Similar Threads

  1. #20382 [Com]: strtotime ("Monday", $date) can produce incorrect output
    By pierre dot baudracco at aliacom dot fr in forum PHP Development
    Replies: 3
    Last Post: December 15th, 05:33 PM
  2. # of prints to produce and the use of "limited editions":
    By Chris Christy in forum Adobe Photoshop Elements
    Replies: 4
    Last Post: August 22nd, 08:19 AM
  3. Replies: 0
    Last Post: August 5th, 01:25 AM
  4. Replies: 0
    Last Post: August 5th, 12:30 AM
  5. Replies: 0
    Last Post: August 4th, 10:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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