If you are talking about obtaining the local system time zone, I already studied this for a long time, and this is impossible, without resorting to either "unsafe" SQL CLR calls or unsupported xp_regread calls xp_regread read this from the registry. The general recommendation is to do this in the application code, not in the database.
However, if you say that you have an offset of -4:00 in your input value, and you want to translate it into the name of the time zone, I am afraid that this is impossible at all, neither in SQL, nor in your application code.
The reason is that there are many time zones that have the same offset. For example, see this Wikipedia page , which shows all zones that use -04:00 .
Even if you limit the scope to the United States only, in some cases it still does not work due to daylight saving time . For example, consider the time 2013-11-03T01:00:00-05:00 . Is it Eastern Standard Time? Or central summer time? It is impossible to say, because at this moment it can be one.
In the United States (as opposed to Europe), each time zone changes at 2 a.m. to its local time. So this is a wave that moves from east to west. While US time zones are typically one hour apart from each other, during the spring-forward transition, they can be two hours apart, and during the transition period, they can have the exact same local time.
source share