How to convert timestamp taking into account daylight savings?

DC-q489h2 126 Reputation points
2021-11-09T18:51:47.22+00:00

I have a timestamp in my data that comes in UTC and I would like to convert to EST/EDT taking into account daylight savings time. Can this be done as part of a data flow?

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,377 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,627 questions
{count} votes

1 answer

Sort by: Most helpful
  1. svijay-MSFT 5,256 Reputation points Microsoft Employee Moderator
    2021-11-10T20:31:34.767+00:00

    Hello @DC-q489h2 ,

    Thanks for the question and using MS Q&A platform.

    You could make use of the fromUTC() function.

    Converts to the timestamp from UTC to TimeZone that you pass. This handles the DST as well.

    So, if you would like to convert to EST.

    fromUTC(<INPUT TIMESTAMP>,'EST')  
    

    I just tried converting current utc timestamp to EST
    148354-image.png

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.