Convert from UTC

Ryan Abbey 1,176 Reputation points
2022-01-23T22:24:50.25+00:00

Can someone tell me what I've done wrong here, I'm running the below to a "Set variable"

@convertFromUtc('2022-01-23 21:50:01', 'New Zealand Standard Time', 'yyyy-MM-dd HH:mm:ss')

and getting back the below error

The function 'convertFromUtc' expects its first parameter to be a string that contains a UTC date time. The value was '2022-01-23T21:50:01.0000000'

I'm pretty certain the same was run last week without error so can't see what I may have had different previously

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.
4,471 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,752 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ronen Ariely 15,096 Reputation points
    2022-01-24T00:58:31.51+00:00

    Hi,

    I am not sure why this did not work for you but to go on the safe side,

    You can try to use the default format for the timestamp which is yyyy-MM-ddTHH:mm:ss:fffffffK (complies with ISO 8601 standards). For example in your case: convertFromUtc('2022-01-23T21:50:01','New Zealand Standard Time')

    Or try to use formatDateTime function: convertFromUtc(formatDateTime('2022-01-23 21:50:01', 'yyyy-MM-ddTHH:mm:ss.fffffffZ'),'New Zealand Standard Time')

    https://learn.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions#convertfromutc


0 additional answers

Sort by: Most helpful