Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 83225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:44:25+00:00 2026-05-10T21:44:25+00:00

Is there a way in Oracle to select the date on which daylight savings

  • 0

Is there a way in Oracle to select the date on which daylight savings will switch over for my locale?

Something vaguely equivalent to this would be nice:

SELECT CHANGEOVER_DATE FROM SOME_SYSTEM_TABLE WHERE DATE_TYPE = 'DAYLIGHT_SAVINGS_CHANGEOVER'   AND TO_CHAR(CHANGEOVER_DATE,'YYYY') = TO_CHAR(SYSDATE,'YYYY');  -- in the current year 

Edit: I was hoping for a solution that would not require changes when Congress adjusts DST laws, as they did in 2007. The posted solutions will work, though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:44:25+00:00Added an answer on May 10, 2026 at 9:44 pm

    We use the following two functions to calculate the start and end dates for any given year (post 2007, US).

    Function DaylightSavingTimeStart (p_Date IN Date) Return Date Is    v_Date       Date;    v_LoopIndex  Integer; Begin    --Set the date to the 8th day of March which will effectively skip the first Sunday.    v_Date := to_date('03/08/' || to_char(p_Date,'YYYY') || '02:00:00 AM','MM/DD/YYYY HH:MI:SS PM');    --Advance to the second Sunday.    FOR v_LoopIndex IN 0..6 LOOP       If (RTRIM(to_char(v_Date + v_LoopIndex,'DAY')) = 'SUNDAY') Then          Return v_Date + v_LoopIndex;       End If;    END LOOP; End;  Function DaylightSavingTimeEnd (p_Date IN Date) Return Date Is    v_Date       Date;    v_LoopIndex  Integer; Begin    --Set Date to the first of November this year    v_Date := to_date('11/01/' || to_char(p_Date,'YYYY') || '02:00:00 AM','MM/DD/YYYY HH:MI:SS PM');    --Advance to the first Sunday    FOR v_LoopIndex IN 0..6 LOOP       If (RTRIM(to_char(v_Date + v_LoopIndex,'DAY')) = 'SUNDAY') Then          Return v_Date + v_LoopIndex;       End If;    END LOOP; End; 

    There is probably a simpler way to do it, but these have worked for us. Of course this query doesn’t know whether daylight saving time is observed for where you are. For that you will need location data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to add dates/times that will be portable between Oracle and
Is there any way in Oracle to determine whether a package has state or
is there any way in Oracle, to get only the dd-mm-yyyy part from an
Is there a way to restore an Oracle 11g instance from raw data files
Is there a way to tune the Oracle client (InstantClient or the normal one)?
Is there a way to get metadata for the Oracle built-in aggeregate and other
Is there any way to stop or terminate long running Oracle query in JDBC
Is there an easy way to determine in a SQL Script if the ORACLE
Is there any other way to get datetime field from oracle database in 24hour
I'm very new to Oracle and was wondering if there's a way either through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.