Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Oracle is Catholic!

 
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(from dbasupport.com)
create or replace type tabDate as table of date
/

create or replace function dates_in_month (p_month date)
return tabDate
pipelined
is
begin
for i in 0 .. to_number(add_months(p_month,1)-p_month-1)
loop
pipe row (p_month+i);
end loop;
return;
end;
/
select * from table (dates_in_month(to_date('01-oct-1582','DD-mon-YYYY')))
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, for those of us who don't have a copy of Oracle lying around to test this on - what's the result? And is it any different from, say, what you'd get for an equivalent program using java.util.GregorianCalendar?
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I wanted to leave it as an excercise for the reader.

COLUMN_VALUE
------------
10/1/1582
10/2/1582
10/3/1582
10/4/1582
10/15/1582
10/16/1582
10/17/1582
10/18/1582
10/19/1582
10/20/1582
10/21/1582
10/22/1582
10/23/1582
10/24/1582
10/25/1582
10/26/1582
10/27/1582
10/28/1582
10/29/1582
10/30/1582
10/31/1582
21 rows selected
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
found this link too..
http://www.geocities.com/calendopaedia/gregory.htm
 
Ranch Hand
Posts: 5390
1
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What abt unix :
At command prompt of any Unix ($), type : cal 9 1752
> Surprised???
> See the explanation for what you see. If you are not in Unix don't
> worry:
> see below:
> September 1752
> S M Tu W Th F S
> 1 2 14 15 16
> 17 18 19 20 21 22 23
> 24 25 26 27 28 29 30
> Isn't the output queer? A month with whole eleven days less?
> This was the time England shifted from Roman Julian Calendar to the
Gregorian Calendar, and the king of England ordered those 11 days to be
wiped off the face of the month of September of 1752. (What couldn't a King
do in those
> days?!)
> And yes, the workers worked for 11 days less, but got paid for the entire
30 days. And that's how "Paid Leave" was born. (Bless those people).
>
>
Dont have unix so just believing what is written here.
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yup thats what I get with cygwin cal on W2K.
    Bookmark Topic Watch Topic
  • New Topic