From:             gavinp at tbs dot uk dot com
Operating system: Debian
PHP version:      4.4.8
PHP Bug Type:     Date/time related
Bug description:  Date is not 'next month' as expected

Description:
------------
Hi [EMAIL PROTECTED],

I have not posted this twice,(however because you locked the last bug I
now have to and in case another user has ... your search system will need
some work then. I could not find a bug describing the same problem. Please
direct me to the correct place that is an open bug and I will happy tag
this onto the end of it.

strtotime('next month', $basedate); where $basedate = today.

Should output the next month. The next month from today is Feb. Simple.
That is the 'expected behaviour'.

That's like saying 2+2 = 4 except on Fridays when it = 5, and then saying
because it's always been like this then it's 'Expected.'

If you are going to refer me to the documentation, please direct me to the
documentations excact location where it says 'next month on the last day of
the month should be two months instead of one.' I can not find this part in
the documentation anywhere also.

However I would love to eat humble pie so please do show me.

Reproduce code:
---------------
$basedate = time(); 

$date1 = strtotime('next month', $basedate); 
$date2 = strtotime('+1 month', $basedate); 
$date3 = strtotime('first month', $basedate); 
$date4 = mktime(0, 0, 0, date("m")+1, date("d"), date("Y"));

$format1 = date('F', $date1);
$format2 = date('F', $date2);
$format3 = date('F', $date3);
$format4 = date('F', $date4);

echo $format1;
echo $format2;
echo $format3;
echo $format4;


Expected result:
----------------
February
February
February
February

Actual result:
--------------
March
March
March
March

-- 
Edit bug report at http://bugs.php.net/?id=43999&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43999&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43999&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43999&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43999&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43999&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43999&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43999&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43999&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43999&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43999&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43999&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43999&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43999&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43999&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43999&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43999&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43999&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43999&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43999&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43999&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43999&r=mysqlcfg

Reply via email to