|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-07-05 05:42 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 11:00:01 2025 UTC |
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.