#41944 [Opn->Asn]: strtotime() not recognizing times before day

From: Date: Wed, 11 Jul 2007 07:20:49 +0000
Subject: #41944 [Opn->Asn]: strtotime() not recognizing times before day
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-114871@lists.php.net to get a copy of this message
ID: 41944 Updated by: tony2001@php.net Reported By: bealdrid at gmail dot com -Status: Open +Status: Assigned Bug Type: Date/time related Operating System: Fedora 7 PHP Version: 5.2.3 -Assigned To: +Assigned To: derick 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

« previous php.bugs (#114871) next »