#18177 [Com]: Second argument to strtotime has no effect

From: Date: Mon, 11 Oct 2004 05:24:03 +0000
Subject: #18177 [Com]: Second argument to strtotime has no effect
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-67380@lists.php.net to get a copy of this message
ID: 18177 Comment by: kwils13 at hotmail dot com Reported By: ph at cpen dot com Status: Bogus Bug Type: Date/time related Operating System: w2k PHP Version: 4.2.1 New Comment: I've experienced the same thing (redhat) int strtotime ( string time [, int now]) ... will try to parse that format into a Unix timestamp RELATIVE TO THE TIMESTAMP GIVEN IN NOW, OR THE CURRENT TIME IF NONE IS SUPPLIED. (sorry wasn't sure how else to give emphasis) echo date("m/d/Y h:i:s",time()); #result: 10/10/2004 10:14:31 echo date("m/d/Y h:i:s",strtotime("+ 1 hour", time())); #result: 10/10/2004 01:00:00 #expected: 10/10/2004 11:14:31 echo date("m/d/Y h:i:s",strtotime("+ 1 hour")); #result: 10/10/2004 01:00:00 #expected: 10/10/2004 11:14:31 it appears that strtotime always returns the date at midnight (00:00:00) and is in fact, not relative to the timestamp given in now or the current time if none is supplied. Suggesting that the second argument seems to have no effect. Previous Comments: ------------------------------------------------------------------------ [2002-07-05 05:43:55] derick@php.net Sorry, but the bug system is not the appropriate forum for asking support questions. Your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php Thank you for your interest in PHP. ------------------------------------------------------------------------ [2002-07-05 05:42:24] ph at cpen dot com The second argument for strtotime seems to have no effect. strtotime("2001-02-02 12:01:01",500); strtotime("2001-02-02 12:01:01",1000); strtotime("2001-02-02 12:01:01",time()); strtotime("2001-02-02 12:01:01"); all gives the same output. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18177&edit=1

« previous php.bugs (#67380) next »