Getdate time zone issue

  • My database is on a hosted server in a different time zone. All of my GETDATE() updates are an hour off. How can I adjust my database to reflect my time zone?

  • You might consider using GETUTCDATE() instead.

    But you need to take care of the different time zone you're in.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Thanks for the reply. I figured out what I need to do. Too simple but I was just using the wrong date function.

    Since the Server time is one hour behind the local time I just need to change to DATEADD

    LocalTime = DATEADD(Hour,+1,GETDATE())

    Since the server location moves to Standard time and Daylight Savings time the same as we do locally this is simple. I would have to do quite a bit more if they did not sync this way.

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

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