From: salathe
Operating system:
PHP version: trunk-SVN-2011-09-13 (SVN)
Package: Date/time related
Bug Type: Bug
Bug description:DateTime "Unknown" day of week
Description:
------------
For lots of negative-year dates, the day of the week is reported as
"Unknown".
Sundays (0th day) are okay. The most modern date affected appears to be
-0007-10-
01.
The test script below runs through each day in the year -10 as an example.
Test script:
---------------
<?php
$utc = new DateTimeZone('UTC');
$period = new DatePeriod(
new DateTime('-0010-01-01', $utc),
new DateInterval('P1D'),
new DateTime('-0009-01-01', $utc)
);
foreach ($period as $date) {
if ($date->format('D') === 'Unknown') {
echo $date->format('Y-m-d D') . PHP_EOL;
}
}
?>
Expected result:
----------------
No output is expected.
Actual result:
--------------
-0010-01-01 Unknown
-0010-01-02 Unknown
-0010-01-03 Unknown
-0010-01-04 Unknown
-0010-01-05 Unknown
-0010-02-01 Unknown
-0010-02-02 Unknown
-0010-03-01 Unknown
-0010-03-02 Unknown
-0010-05-01 Unknown
-0010-05-02 Unknown
-0010-05-03 Unknown
-0010-05-04 Unknown
-0010-06-01 Unknown
-0010-08-01 Unknown
-0010-08-02 Unknown
-0010-08-03 Unknown
-0010-10-01 Unknown
-0010-10-02 Unknown
-0010-10-03 Unknown
-0010-10-04 Unknown
-0010-10-05 Unknown
-0010-11-01 Unknown
-0010-11-02 Unknown
--
Edit bug report at https://bugs.php.net/bug.php?id=55687&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55687&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55687&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=55687&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55687&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=55687&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55687&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=55687&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=55687&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=55687&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=55687&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=55687&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=55687&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=55687&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55687&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=55687&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55687&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=55687&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=55687&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=55687&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=55687&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=55687&r=mysqlcfg