How to get an UTC offset for different locations in the world?

  • I am building a Date table for many years ahead. There are 3 columns in this table that should show UTC offset from NYC, London, Hongkong. Since our server in NYC, it is easy to run function SYSDATETIMEOFFSET() for NY. But how can I get it for London and Hongkong? Is there anything I can pass to that function?

  • Hi

    I was interested in your question, and did a bit of research. - However I don't think there is a way to access the timezone offsets from within SQL Server,

    I think you will have to write a new the function and pass a location parameter - and either hard-code offsets, or create your won timezone offset lookup table - there must be a standard for this somewhere.

    and while looking for a standard - I found this, which seems to cover what you want.

    http://blogs.msdn.com/b/sqlprogrammability/archive/2008/03/18/using-time-zone-data-in-sql-server-2008.aspx

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

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