note 45270 rejected from function.strtotime by tomsommer

From: Date: Tue, 31 Aug 2004 23:43:14 +0000
Subject: note 45270 rejected from function.strtotime by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-75786@lists.php.net to get a copy of this message
Note Submitter: mikep at pawlowsky dot com ---- Just thought I would point out a bug in PHP Version 4.3.8 using strtotime "+1 month". It seems to have a problem on the 31st of the month. It returns the next month after what you would expect. So +1 month of August is October, +1 month of October is December etc. You can try this code out to see the bug: <?php $timestamp = mktime(20,30,0,10,31,2004); echo date('l, F jS, Y \a\t H:i', $timestamp) . "<br>\n"; $next_month_timestamp = strtotime("+1 month", $timestamp); echo date('l, F jS, Y \a\t H:i', $next_month_timestamp); ?> Cheers, Mike

« previous php.notes (#75786) next »