ADF Dataflow Derive Column transformation toTimestamp is working for constant timezone but not from column

David Buterbaugh 21 Reputation points
2025-03-06T20:47:30.6366667+00:00

I am finding Azure Data Factory Dataflow Dataflow Derive Column transformation toTimestamp is working for constant timezone but not from column. I want each column to output the date with time adjusted based on the timezone UTC offset. Any suggestions on a solution?

The constant works with this expression:


toTimestamp(toString(toTimestamp('2022-05-23', 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'yyyy-MM-dd', 'EST')


Data preview:

User's image

But this column expression does not:


toTimestamp(toString(toTimestamp('2022-05-23', 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'yyyy-MM-dd', TIMEZONENAME)

Data preview:

User's image

We've previously done something like this, but found that it does not work for some Windows time zones and IANA time zones.

toTimestamp(concat(toString(toTimestamp('2022-05-23', 'yyyy-MM-dd'), 'yyyy-MM-dd'), ' ', TIMEZONENAME), 'yyyy-MM-dd zzzz')

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,323 questions
{count} votes

Accepted answer
  1. Chandra Boorla 9,685 Reputation points Microsoft External Staff
    2025-03-07T17:31:33.0733333+00:00

    @David Buterbaugh

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Issue:

    ADF Dataflow Derive Column transformation toTimestamp is working for constant timezone but not from column

    Solution:

    The toTimestamp function doesn't support column timezones, but it seems that toUTC does.

    toUTC() supporting dynamic time zones is a game-changer, especially when dealing with daylight savings time adjustments.

    Expression:

    toUTC(toTimestamp(toString(toTimestamp('2022-05-23', 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'yyyy-MM-dd'), TIMEZONENAME)
    

    Dynamically resolves TIMEZONENAME without needing a constant value.

    Properly adjusts for daylight savings time, unlike static UTC offsets.

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. David Buterbaugh 21 Reputation points
    2025-03-07T16:28:19.1733333+00:00

    As Chandra Boorla mentions, toTimestamp doesn't support column timezones. But it appears toUTC does. This appears to meet my need.

    toUTC(toTimestamp(toString(toTimestamp('2022-05-23', 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'yyyy-MM-dd'), TIMEZONENAME)
    
    
    

    Note that using an offset doesn't really work well with daylight savings time as that offset may change depending on the calendar date.


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.