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 checked at work and strtotime works properly on php 4.3.3 (also
redhat). However at home I'm using 5.0.
Previous Comments:
------------------------------------------------------------------------
[2004-10-11 07:23:58] kwils13 at hotmail dot com
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.
------------------------------------------------------------------------
[2002-07-05 05:43:55] [EMAIL PROTECTED]
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