Skip to main content

Notifications

Power Automate - Translation Quality Feedback
Suggested answer

I get not the local time from the automate back

(0) ShareShare
ReportReport
Posted on by 899
Hello,
 
I have the Power Automate below but I don't get the correct local time in the Excel table.

The correct time is in the received message but as soon as it goes through the Power Automate I have an incorrect time in the sheet.
 
What can I change?
 
Categories:
  • Chriddle Profile Picture
    Chriddle 7,159 on at
    I get not the local time from the automate back
    Just replace utcNow() with triggerBody()?['DateTimeReceived'] in your expression.
  • frixel Profile Picture
    frixel 899 on at
    I get not the local time from the automate back
    I can do this 
    convertTimeZone(utcnow(),'UTC','W. Europe Standard Time','dd/MM/yyyy HH:mm:ss')
    in the expression what is working with the right time and date in the Excel sheet
     
    But than it takes NOT the time that the eMail is received.
     
  • Suggested answer
    David_MA Profile Picture
    David_MA 7,740 on at
    I get not the local time from the automate back
    I believe your problem Is caused because your expression is not valid. The expression needs to include T in the expression: addHours(triggerBody()?['DateTimeReceived'],'yyyy-MM-ddTHH:mm:ss')
  • frixel Profile Picture
    frixel 899 on at
    I get not the local time from the automate back
    When i do this then i get the right time
     
    addHours(triggerBody()?['DateTimeReceived'],1,'dd-MM-yyyy HH:mm:ss')
     
    So i think i must 
    addHours(triggerBody()?['DateTimeReceived'],'dd-MM-yyyy HH:mm:ss')
    combine with 
    utcnow() 
     
    is that what it is, i don`t know how to do that 
  • frixel Profile Picture
    frixel 899 on at
    I get not the local time from the automate back
    i don`t understand 😢
     
    When i don`t use the '2' in: 
     
    addHours(triggerBody()?['DateTimeReceived'],'dd-MM-yyyy HH:mm:ss')
     
    then i get this error
     
  • Chriddle Profile Picture
    Chriddle 7,159 on at
    I get not the local time from the automate back
    The error is from the addHours() function and it states that the datetime value is null.
    This shouldn't happen. Are you sure that you are processing triggerOutputs()?['body/receivedDateTime']
     
    Furthermore 
    Why do you still add 2 hours?
    Why do you convert utcNow() to local time. Isn't this about triggerOutputs()?['body/receivedDateTime']?
  • frixel Profile Picture
    frixel 899 on at
    I get not the local time from the automate back
    Hi @Chriddle
     
    Now i get this.

     
    But i get then this error.

  • Chriddle Profile Picture
    Chriddle 7,159 on at
    I get not the local time from the automate back
    The date probably is in UTC.
    Use convertFromUtc() to convert to your local time zone.
     
    If the according Excel column is formated as DateTime, don't use a format string but set the Excel connector's DateTime Format to ISO 8601 (in the connector's advanced options) and set the values display settings within Excel.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,867

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,174

Leaderboard

Featured topics