From:             
Operating system: Linux
PHP version:      5.3.10
Package:          Date/time related
Bug Type:         Bug
Bug description:Wrong Day of Week

Description:
------------
The 15th October 1582 is a Friday (see 
http://en.wikipedia.org/wiki/Gregorian_calendar). Testing with Python and
Java 
confirms this as well. Also checked the Gnome calendar.

The Proleptic Gregorian Calendar (see 
http://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar) just extends the

Gregorian calendar backwards. I'm assuming PHP is using proleptic calendar,
which 
would make 4th october 1582 a monday. But again DateTime gets it wrong.

I made a script to find the breaking point, and it occurs at 31st December
1599. 
It returns it as a Saturday when in fact its a Friday.



Test script:
---------------
<?php
$date = new DateTime();
$date->setDate(1582, 10, 15);
echo $date->format('l, jS F Y') . PHP_EOL;

$date->setDate(1599, 12, 31);
echo $date->format('l, jS F Y') . PHP_EOL;

Expected result:
----------------
Friday, 15th October 1582
Friday, 31st December 1599

Actual result:
--------------
Saturday, 15th October 1582
Saturday, 31st December 1599

-- 
Edit bug report at https://bugs.php.net/bug.php?id=61599&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=61599&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=61599&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=61599&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=61599&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=61599&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=61599&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=61599&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=61599&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=61599&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=61599&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=61599&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=61599&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=61599&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=61599&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=61599&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=61599&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=61599&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=61599&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=61599&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=61599&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=61599&r=mysqlcfg

Reply via email to