Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
h4tt3n
Resolver II
Resolver II

Convert IANA TimeZone name to UTC / GMT?

Hello,

 

Using Transact-SQL, is there a way to convert an IANA time zone name string to a GMT or UTC offset?

 

I have access to customer timezone data only as an IANA tz formatted string in the form of eg. Europe/Paris or America/New_York, and I need to convert this string into a number with which I can offset a datetime column to represent customer local time.

 

The function AT TIME ZONE apparently won't work in this case.

 

Thanks in advance!

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @h4tt3n ,

 

Unfortunately, there is no good solution for this kind of issue, but there are some alternatives.

In my opinion, I'd like to suggest you add a location table to collection these locations and group them to different timezone country groups.
After these steps, you can use above table to accurate mapping records and modify them with their timezone group offset.

Please refer to these thread:https://stackoverflow.com/questions/57261944/apply-timezone-by-id-on-power-bi 

https://community.powerbi.com/t5/Desktop/Convert-UTC-to-timezones/m-p/354322 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@V-lianl-msft

 

I suspected that I might have to build a table for this. Given the popularity if the IANA tz system, I can only hope that one day Microsoft will include support for it in their products. Thanks for the links, I will look into them.

 

Challenge is still unsolved.

@amitchandak Sorry, but these suggestions won't work. It has to be a function that specifically deals with the IANA timezone format Region/City, eg Europe/Paris to GMT or UTC. 

 

I am still looking for a way to solve this.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.