Search code examples
azureazure-logic-appsdatetime-format

Logic Apps: How to set local date/time with UTC hour offset


In Azure Logic Apps I want to convert the UTC time.

If the UTC date/time is: 2023-10-30T18:31:05.123

I want to convert the UTC date/time to EST and format the date/time as: 2023-10-30T14:31:05.123-04:00

I've tried this: convertTimeZone(utcNow(),'UTC','Eastern Standard Time','yyyy-MM-ddTHH:mm:ss.fffzzz')

But the result is this: 2023-10-30T14:31:05.123+00:00

i.e. I'm not getting the correct UTC hour offset, it should be -04:00.


Solution

  • I have reproduced in my environment and below are my observations:

    In Logic apps the connector gives us +00:00 even i have tried:

    enter image description here

    You are going in right direction, getting the difference and then concatenating it and AFAIK, there is no other way to do so other than that(or by manually concatenating -4:00 at end):

    Design:

    enter image description here

    Output:

    enter image description here