Bug #63391 [NEW]: [PATCH] Incorrect/inconsistent day of week prior to the year 1600
| From: | tcarter at noggin dot com dot au | Date: | Tue, 30 Oct 2012 01:44:22 +0000 |
| Subject: | Bug #63391 [NEW]: [PATCH] Incorrect/inconsistent day of week prior to the year 1600 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-174412@lists.php.net to get a copy of this message | ||
From: tcarter at noggin dot com dot au
Operating system: Linux (x86_64)
PHP version: 5.4.8
Package: Date/time related
Bug Type: Bug
Bug description:[PATCH] Incorrect/inconsistent day of week prior to the year 1600
Description:
------------
PHP timelib calculates the day of the week incorrectly for dates prior to
the 1st of January 1600.
Test script:
---------------
<?php
ini_set('date.timezone', 'UTC');
print "Date PHP OS\n";
print "---------- --- ---\n";
$dates = array('1599-12-30', '1599-12-31', '1600-01-01',
'1600-01-02');
foreach ($dates as $date) {
print strftime(
"%Y-%m-%d %a ",
strtotime($date)
) .
env TZ=UTC date --date=$date +%a;
}
?>
Expected result:
----------------
Date PHP OS
---------- --- ---
1599-12-30 Thu Thu
1599-12-31 Fri Fri
1600-01-01 Sat Sat
1600-01-02 Sun Sun
Actual result:
--------------
Date PHP OS
---------- --- ---
1599-12-30 Fri Thu
1599-12-31 Sat Fri
1600-01-01 Sat Sat
1600-01-02 Sun Sun
--
Edit bug report at https://bugs.php.net/bug.php?id=63391&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63391&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63391&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63391&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63391&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63391&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63391&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63391&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63391&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63391&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63391&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63391&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63391&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63391&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63391&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63391&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63391&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63391&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63391&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63391&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63391&r=mysqlcfg