PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Date and Time » Date » Bug #969

Dates created from a string don't set properties correctly

Details

Submitted2004-03-08 05:30 UTC
Fromredbeard at mdjohnson dot us
Assignedpajoye
StatusClosed
PackageDate
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[2004-03-08 05:30 UTC] redbeard at mdjohnson dot us

Description:
------------
When creating a date from a string, the various properties (year, month, day, etc) are set to strings instead of integers. This results in calls to the access methods (e.g. getDay()) to return strings, which can result in incorrect output.

Reproduce code:
---------------
$d = new Date('2004-01-01');
echo $d->getDay();

Expected result:
----------------
1

Actual result:
--------------
01