CeDeT: OIF (Oracle is funny (that way)) #5

Those were the days

Oracle seems to think that certain days of October 1582 are one and the same - see test below. Please note that this is not considered a bug - consult Calendopaedia - The Gregorian Calendar and The Calendar FAQ to figure out why that is.

However, Oracle is not capable of handling the non-existence of year 0 correctly - see Julian days and year 0 (bug).

The test

SQL> select * from v$version where rownum<2;

BANNER                                                                          
----------------------------------------------------------------                
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production                      

SQL> set pagesize 20
SQL> select to_char(to_date('03101582','DDMMYYYY'),'DDMMYYYY') "That day" from dual
  2  union all
  3  select to_char(to_date('04101582','DDMMYYYY'),'DDMMYYYY') from dual
  4  union all
  5  select to_char(to_date('05101582','DDMMYYYY'),'DDMMYYYY') from dual
  6  union all
  7  select to_char(to_date('06101582','DDMMYYYY'),'DDMMYYYY') from dual
  8  union all
  9  select to_char(to_date('07101582','DDMMYYYY'),'DDMMYYYY') from dual
 10  union all
 11  select to_char(to_date('08101582','DDMMYYYY'),'DDMMYYYY') from dual
 12  union all
 13  select to_char(to_date('09101582','DDMMYYYY'),'DDMMYYYY') from dual
 14  union all
 15  select to_char(to_date('10101582','DDMMYYYY'),'DDMMYYYY') from dual
 16  union all
 17  select to_char(to_date('11101582','DDMMYYYY'),'DDMMYYYY') from dual
 18  union all
 19  select to_char(to_date('12101582','DDMMYYYY'),'DDMMYYYY') from dual
 20  union all
 21  select to_char(to_date('13101582','DDMMYYYY'),'DDMMYYYY') from dual
 22  union all
 23  select to_char(to_date('14101582','DDMMYYYY'),'DDMMYYYY') from dual
 24  union all
 25  select to_char(to_date('15101582','DDMMYYYY'),'DDMMYYYY') from dual
 26  union all
 27  select to_char(to_date('16101582','DDMMYYYY'),'DDMMYYYY') from dual
 28  union all
 29  select to_char(to_date('17101582','DDMMYYYY'),'DDMMYYYY') from dual;

That day                                                                        
--------                                                                        
03101582                                                                        
04101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
15101582                                                                        
16101582                                                                        
17101582                                                                        

15 rækker er valgt.

SQL> select to_char(to_date('05101582','DDMMYYYY'),'DDMMYYYY') "What day" from dual
  2  union
  3  select to_char(to_date('06101582','DDMMYYYY'),'DDMMYYYY') from dual
  4  union
  5  select to_char(to_date('07101582','DDMMYYYY'),'DDMMYYYY') from dual
  6  union
  7  select to_char(to_date('08101582','DDMMYYYY'),'DDMMYYYY') from dual
  8  union
  9  select to_char(to_date('09101582','DDMMYYYY'),'DDMMYYYY') from dual
 10  union
 11  select to_char(to_date('10101582','DDMMYYYY'),'DDMMYYYY') from dual
 12  union
 13  select to_char(to_date('11101582','DDMMYYYY'),'DDMMYYYY') from dual
 14  union
 15  select to_char(to_date('12101582','DDMMYYYY'),'DDMMYYYY') from dual
 16  union
 17  select to_char(to_date('13101582','DDMMYYYY'),'DDMMYYYY') from dual
 18  union
 19  select to_char(to_date('14101582','DDMMYYYY'),'DDMMYYYY') from dual
 20  union
 21  select to_char(to_date('15101582','DDMMYYYY'),'DDMMYYYY') from dual;

What day                                                                        
--------                                                                        
15101582