RE: [PHP] strtotime()

From: Date: Wed, 13 Aug 2003 18:43:12 +0000
Subject: RE: [PHP] strtotime()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-159468@lists.php.net to get a copy of this message
> strtotime( '+1 month', mktime( 0, 0, 0, 1, 1, 2003 )); > > I get back the timestamp for 1/31/2003 and not 2/1/2003. > Are you sure? I tried it on my system (php 4.2.3 freeBSD 4.6.2) and this is the output I got... # php <?php echo date("Y-m-d", mktime( 0, 0, 0, 1, 1, 2003 ))."\n"; echo date("Y-m-d",strtotime( '+1 month', mktime( 0, 0, 0, 1, 1, 2003 )))."\n"; ?> X-Powered-By: PHP/4.2.3 Content-type: text/html 2003-01-01 2003-02-01 What are you doing with the timestamp strtotime gives you? Could that be where the error is?

« previous php.general (#159468) next »