2005 ever have an issue with Daylight Savings?

  • I'm in the middle of playing with converting someones work for calculating the surise/suset of a given lattitude and longitude via TSQL;

    i notice in the comments of the code, someone claims that

    select getutcdate() - getdate() --for me, it's 1900-01-01 04:00:00.000 (four hours)

    can return the wrong difference in SQL 2005.

    my Google-Fu is strong, and i cannot find anything related to erroneous results.

    Ever hear of SQL 2005 giving incorrect results as a result of Daylight Savings Time? I installed 2005 Developer RTM to test, but a limited,test of today doesn't really fully test anything.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • I think SQL just works with the system date of the computer, and the time zone and DST settings, so I would think any error would be from incorrect settings on the computer, not SQL's fault.

  • that's what i thought too, homebrew; i could see that if you didn't apply the DST patch in 2007 on your Windows operating System, where they moved the default DST times, might be off for a week or two, but the code comment inferred an actual calculation error...didn't make sense from something so basic.

    Thanks for confirming what I had suspected; nice to hear the same thoughts from a peer.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • the getdate is using the OS timezone. I worked around the issue in sql 2005 using a clr fuction created to use syste.timezoneoffset object

    Jayanth Kurup[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply