ID:               41944
 User updated by:  bealdrid at gmail dot com
 Reported By:      bealdrid at gmail dot com
 Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Fedora 7
 PHP Version:      5.2.3
 New Comment:

Thanks for the insight; the process that the string is "executed" makes
sense.  But why the change?  We have code written and tested with PHP
4.3.9, which is now partially broken due to the change in design choice
you reference.  What might you suggest would be a work around to get the
desired result, as I used to get in 4.3.9?


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

[2007-07-11 21:04:31] [EMAIL PROTECTED]

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.

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

[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