What if you have a PL/SQL procedure that bases processes on dates and hours, and you need to determine if a date is DST Start or DST End? Use the following built-in functions to capture DST Start and End for your application and apply as you see fit. Just remember the rules: 1) DST_Start is ALWAYS the first SUNDAY of April and 2) DST_End is ALWAYS the last SUNDAY of October.
SELECT NEXT_DAY(TO_DATE(TO_CHAR(V_DATE,'YYYY')||'-03-31','YYYY-MM-DD'),'SUNDAY') INTO dst_start FROM dual; SELECT NEXT_DAY(TO_DATE(TO_CHAR(V_DATE,'YYYY')||'-10-31','YYYY-MM-DD')-7,'SUNDAY') INTO dst_end FROM dual;
For More Information
- What do you think about this tip? E-mail us at
- editor@searchDatabase.com with your feedback.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- The Best SQL Web Links
- Have a SQL tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
- Ask your technical Oracle questions--or help out your peers by answering them--in our live discussion forums.
- Ask the Experts yourself: Our Oracle gurus are waiting to answer your technical questions.
This was first published in May 2001