Req #66610 [NEW]: +1 Month on Leap Year

From: Date: Thu, 30 Jan 2014 08:01:10 +0000
Subject: Req #66610 [NEW]: +1 Month on Leap Year
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184085@lists.php.net to get a copy of this message
From:             me at jacobt dot com
Operating system: Centos 6
PHP version:      5.5.9RC1
Package:          Date/time related
Bug Type:         Feature/Change Request
Bug description:+1 Month on Leap Year

Description:
------------
Please check out the following example...

http://codepad.viper-7.com/1Scqvd

I'm not sure who thought this was the right thing to do, but it's not. 
For how MySQL handles it...

mysql> SELECT DATE_ADD('2009-01-30', INTERVAL 1 MONTH);
-> '2009-02-28'

I find that more acceptable.  Or, what I would actually prefer is March
1.  If you're going to add time, which is basically what you're doing
here b/c a month isn't a set number of days, add the minimum number
required to get the job done, no more than that...

Test script:
---------------
http://codepad.viper-7.com/1Scqvd

Expected result:
----------------
It should be clear in the file and description


-- 
Edit bug report at https://bugs.php.net/bug.php?id=66610&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66610&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66610&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66610&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66610&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66610&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66610&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66610&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66610&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66610&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66610&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66610&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66610&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66610&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66610&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66610&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66610&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66610&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66610&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66610&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66610&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#184085) next »