From:
Operating system: debian
PHP version: 5.3.10
Package: Date/time related
Bug Type: Bug
Bug description:date with strtotime
Description:
------------
I used this function as below but i have problem in February month
if 'user_invoice_date' equal 2012-01-30 or 2012-01-31
the 'new_invoice_date' equal 2012-03-01
$new_invoice_date=date("Y-m-01 H:i:s",strtotime($user_invoice_date."+1
month"));
Test script:
---------------
normal
$user_invoice_date="2011-12-31";
$new_invoice_date=date("Y-m-01 H:i:s",strtotime($user_invoice_date."+1
month"));
////////////////
Error
$user_invoice_date="2012-01-31";
$new_invoice_date=date("Y-m-01 H:i:s",strtotime($user_invoice_date."+1
month"));
echo $new_invoice_date;
Expected result:
----------------
$user_invoice_date="2012-01-31";
$new_invoice_date=date("Y-m-01 H:i:s",strtotime($user_invoice_date."+1
month"));
$new_invoice_date=2012-02-01
2012-02-01
Actual result:
--------------
$new_invoice_date=2012-03-01
2012-03-01
--
Edit bug report at https://bugs.php.net/bug.php?id=60980&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=60980&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=60980&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=60980&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=60980&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=60980&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=60980&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=60980&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=60980&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=60980&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=60980&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=60980&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=60980&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=60980&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=60980&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=60980&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60980&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=60980&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=60980&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=60980&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=60980&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=60980&r=mysqlcfg