ID:               41944
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bealdrid at gmail dot com
-Status:           Assigned
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Fedora 7
 PHP Version:      5.2.3
 Assigned To:      derick
 New Comment:

This is not a bug, but a design choice. The new parser "Executes" the
different parts of the string in order. So first "yesterday" and then
"1am" moves to yesterday midnight first, and then to 1am. The opposite
way first moves it to "1am" of the current day, and then back to
yesterday midnight.


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

[2007-07-09 21:00:54] bealdrid at gmail dot com

Description:
------------
when calling the strtotime() function and when passing a time before
the day such as "1pm yesterday" the wrong timestamp is returned, often
midnite of that particular day.  


Reproduce code:
---------------
echo date('Y-m-d H:i:s',strtotime('1pm yesterday'));



Expected result:
----------------
The expected result would be 

2007-07-08 13:00:00 and this works in php 4.3.9

If I put the time after the day, such as "yesterday 1pm", it behaves as
expected.  



Actual result:
--------------
2007-07-08 00:00:00


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


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

Reply via email to