Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Aruneesh Salhotra

Aruneesh Salhotra

From: Aruneesh Salhotra <asalhotra_at_customink.com>
Date: 11 Jun 2003 09:45:25 -0700
Message-ID: <a29eb1e7.0306110845.2c86b0ec@posting.google.com>


I created a oracle query which detects the start and end date for dayight saving. I eventually used this, and passed the current year so to detect start/end dates for daylight saving for each year.

I wanted to share the same with everyone.

select SYSDATE x, 0 r1 from dual where SYSDATE between (select decode(to_char(to_date('04/01/2003','MM/DD/YYYY'),'D'),1,

to_date('04/01/2003','MM/DD/YYYY')+7, 2,
to_date('04/01/2003','MM/DD/YYYY')+6, 3,
to_date('04/01/2003','MM/DD/YYYY')+5, 4,
to_date('04/01/2003','MM/DD/YYYY')+4, 5,
to_date('04/01/2003','MM/DD/YYYY')+3, 6,
to_date('04/01/2003','MM/DD/YYYY')+2,
to_date('04/01/2003','MM/DD/YYYY'))  sday1 from dual) and (select
decode(to_char(to_date('09/01/2003','MM/DD/YYYY'),'D'),1,
to_date('09/01/2003','MM/DD/YYYY')+7, 2,
to_date('09/01/2003','MM/DD/YYYY')+6, 3,
to_date('09/01/2003','MM/DD/YYYY')+5, 4,
to_date('09/01/2003','MM/DD/YYYY')+4, 5,
to_date('09/01/2003','MM/DD/YYYY')+3, 6,
to_date('09/01/2003','MM/DD/YYYY')+2,
to_date('09/01/2003','MM/DD/YYYY'))  sday2 from dual);
Received on Wed Jun 11 2003 - 11:45:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US