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

 ID:                 53741
 Updated by:         [email protected]
 Reported by:        metwo at gmx dot net
 Summary:            DateTime, date_create, strtotime - wrong result on
                     realtive date time string
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            Date/time related
 Operating System:   inux 2.6.36.3 x86_64
 PHP Version:        5.2.17
 Block user comment: N
 Private report:     N

 New Comment:

5.2 is no longer supported.


Previous Comments:
------------------------------------------------------------------------
[2011-01-13 17:24:56] metwo at gmx dot net

Description:
------------
parsing of relative date/time string "midnight first day last month"
returns a wrong result in php 5.2.17

Test script:
---------------
<?php



print_r(date_create('midnight first day last month'));

print $d->format('Y-m-d H:i:s') . "\n";

print date('Y-m-d H:i:s', strtotime('midnight first day last month'));



Expected result:
----------------
// relative to current date/time - 2011-01-13 17:23



DateTime Object

(

    [date] => 2010-12-01 00:00:00

    [timezone_type] => 3

    [timezone] => Europe/Berlin

)

2010-12-01 00:00:00

2010-12-01 00:00:00



Actual result:
--------------
// relative to current date/time - 2011-01-13 17:23



DateTime Object

(

)

2010-12-14 00:00:00

2010-12-14 00:00:00




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



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53741&edit=1

Reply via email to