How can we set the Time Zone of a database permenently?

  • Hello,

    How can we set the Time Zone of a database permenently?

    It should work regardless of OS Time Zone.

    Any solution for getting different datatime for two different database instance running on same sql server.

    Any Solution other than getutcdate() in appreciable

    Regards,

    KCube

  • SQL defers to the OS for knowing date, time and timezone. You can't set it within SQL Server.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • In SQL 2008 you could use the DateOffset type, but there really isn't a way to do that in SQL 2000/2005, without building a complex control of your own.

    You could build a function that would read the current time from the OS, and modify it by the time-zone you want to use, then use that function instead of getdate(). Might work.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks very much for the help

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

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