Categories: Scripts

SQL Server 2016: Look up the Current UTC Offset and Daylight Savings Time indicator for any Time Zone

Sql Server 2016, ships with a new system catalog view that returns the current UTC Offset for a given time zone and whether the time zone is currently observing Daylight Savings Time.

Fun fact: Not all UTC offsets are in one hour increments. Some are only 30 minutes.

The time zones listed are the ones that have been installed on the machine where the SQL Server instance is running. The list of string time zone names are in Windows time zone format.

Fun fact: Unless you’re a scientist, GMT are the UTC are the same.

The view returns a list of time zones, along with it’s UTC Offset and a bitwise operator, to indicate whether the time zone is observing Daylight Savings Time.

Example Output

Querying the View

<span id="mce_SELREST_end" style="overflow: hidden; line-height: 0;"></span>
SELECT [name] ,
[current_utc_offset] ,
[is_currently_dst] FROM [sys].[time_zone_info];

Fun fact: UTC stands for Coordinated Universal Time. If that seems backwards, it’s because UTC is in the French word order, instead of the English word order you were expecting.

 

Rick Bishop

Recent Posts

C# System.Uri Class Examples

If you've needed to parse or construct a URI in C#, you've likely done it…

6 years ago

C# Basics – Access Modifiers

The second installment in my series of C# basics illustrates the proper use of access…

6 years ago

C# Coding Style

This page details the coding style I've adopted for C# code in my applications. You…

6 years ago

C# Basics – Inheritance

For the new C# section of my website, I wanted to post some notes that…

6 years ago

5 Reasons to Lock Down Your LinkedIn Profile

There are some pretty compelling reasons to lock down your LinkedIn account now. We bet…

6 years ago

LinkedIn is Ignoring Your Privacy Settings and You Paid Them to Do It

We bet you didn't know that your full name, picture, work history, and more may…

6 years ago