Bug #55687 [Asn->Nab]: DateTime "Unknown" day of week

From: Date: Tue, 20 Jan 2015 21:24:44 +0000
Subject: Bug #55687 [Asn->Nab]: DateTime "Unknown" day of week
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190089@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55687&edit=1 ID: 55687 Updated by: derick@php.net Reported by: salathe@php.net Summary: DateTime "Unknown" day of week -Status: Assigned +Status: Not a bug Type: Bug Package: Date/time related PHP Version: trunk-SVN-2011-09-13 (SVN) Assigned To: derick Block user comment: N Private report: N New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. This is fixed in PHp 5.5 (at least 5.5.21-dev). Previous Comments: ------------------------------------------------------------------------ [2011-09-13 20:54:01] salathe@php.net 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 this bug report at https://bugs.php.net/bug.php?id=55687&edit=1

« previous php.bugs (#190089) next »