#40861 [Opn->Asn]: strtotime() behaviour has changed

From: Date: Tue, 20 Mar 2007 10:04:42 +0000
Subject: #40861 [Opn->Asn]: strtotime() behaviour has changed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-110545@lists.php.net to get a copy of this message
ID: 40861 Updated by: tony2001@php.net Reported By: eheien at heli-one dot ca -Status: Open +Status: Assigned Bug Type: Date/time related Operating System: Windows 2003 and XP PHP Version: 5.2.1 -Assigned To: +Assigned To: derick Previous Comments: ------------------------------------------------------------------------ [2007-03-20 09:07:49] eheien at heli-one dot ca Description: ------------ strtotime() fails when supplied with both a negative and positive argument. This worked in php 5.0.5 and php 4.x.x. +- = - ++ = + -- = + Reproduce code: --------------- $offset = -60; $ts = strtotime('2000-01-01 12:00:00'); $result = date("Y-m-d H:i:s", strtotime("+$offset minutes", $ts)); echo $result; Expected result: ---------------- 2000-01-01 11:00:00 Actual result: -------------- 1970-01-01 01:00:00 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40861&edit=1

« previous php.bugs (#110545) next »