#35983 [Opn->Asn]: strtotime(string, now) behavior has changed

From: Date: Fri, 13 Jan 2006 08:15:00 +0000
Subject: #35983 [Opn->Asn]: strtotime(string, now) behavior has changed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91822@lists.php.net to get a copy of this message
 ID:               35983
 Updated by:       sniper@php.net
 Reported By:      tim at komta dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Date/time related
 Operating System: Windows XP Pro, Server 2003
 PHP Version:      5.1.2
-Assigned To:      
+Assigned To:      derick
 New Comment:

Assigned to the date man.


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

[2006-01-12 19:51:13] tim at komta dot com

Description:
------------
Prior to PHP 5.1.2 (potentially earlier, just only noticed it)
strtotime(), when used with the optional 'now' argument, would return
the time using the full 'now'.  Now it returns 00:00 on the date of the
'now', ignoring hours, minutes, and seconds.

Reproduce code:
---------------
$this_morning 	= strtotime('today 00:00:00');
$tonight		= strtotime('today 23:59:59');

echo date('m/d Hi', strtotime('yesterday',
$this_morning)).'<br/>';
echo date('m/d Hi', strtotime('yesterday', $tonight)).'<br/>';

Expected result:
----------------
(as of 2005-01-12):

01/11 0000
01/11 2359

Actual result:
--------------
(as of 2005-01-12):

01/11 0000
01/11 0000


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


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


Thread (4 messages)

« previous php.bugs (#91822) next »