#24324 [NEW]: PEAR :: Date :: getWeeksInMonth () -- Ocassionally Wrong
| From: | cricket at djcricket dot com | Date: | Wed, 25 Jun 2003 02:03:24 +0000 |
| Subject: | #24324 [NEW]: PEAR :: Date :: getWeeksInMonth () -- Ocassionally Wrong | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-17686@lists.php.net to get a copy of this message | ||
From: cricket at djcricket dot com
Operating system: FreeBSD 4.8-STABLE
PHP version: 4.3.2
PHP Bug Type: PEAR related
Bug description: PEAR :: Date :: getWeeksInMonth () -- Ocassionally Wrong
Description:
------------
When Using the getWeeksInMonth() method of the PEAR::Date class,
ocassionally the calculation is wrong. The following code shows that
July/2003 returns 6 weeks in the month, instead of 5.
This error was duplicated with the same code on a RedHat 7.3 box as well.
Reproduce code:
---------------
require_once 'Date.php';
$date = new Date ( mktime ( 0 , 0 , 0 , 6 , 1 , 2003 ) );
echo "Date: " . $date->getDate () . "<br>\nWeeks In Month: " .
$date->getWeeksInMonth ();
Expected result:
----------------
Date: 2003-06-01 00:00:00
Weeks In Month: 5
Actual result:
--------------
Date: 2003-06-01 00:00:00
Weeks In Month: 6
--
Edit bug report at http://bugs.php.net/?id=24324&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24324&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24324&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24324&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24324&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24324&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24324&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24324&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24324&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24324&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24324&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24324&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24324&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24324&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24324&r=gnused