Skip to main content

Notifications

Power Automate - Building Flows
Answered

Wrong date and time on Power Automate Flow

(0) ShareShare
ReportReport
Posted on by 19
Hello,
 
I hope someone can help me with something that maybe is really easy, but I'm a newbie at Power Automate. I have a flow that get a list of items from sharepoint and send an email with that items in an HTML table. The problem is, that 2 of these items are dates, and when the email arrives the dates are wrong. 
 
 
So, as you can see, in the email each item is adding 6 hours to the original dates in sharepoint. I've read that this is because sharepoint uses UTC, and I should convert the time zone to fit with mine (UTC-06:00), however, I don't know how or where to do that inside my flow without affecting the final result. This is how my flow looks like:
 
 
Any help would be really appreciated, and please, if you could explain like you would explain to a 12 years old, it would be great.

Regards.
  • esilva83 Profile Picture
    esilva83 19 on at
    Wrong date and time on Power Automate Flow
    @Pstork1 @EKarim Thanks both of you for your kind replies.
     
    Now my flow is working as expected.
     
    Best regards.
  • Verified answer
    Pstork1 Profile Picture
    Pstork1 64,420 on at
    Wrong date and time on Power Automate Flow
    One thing to add to @EKarim s explanation.  In your case you should use the ConvertFromUtc() function in the Data Select action in your flow. Then you'll have the dates and times in the format you want them to be to create the HTML table.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Suggested answer
    EKarim Profile Picture
    EKarim 10,457 on at
    Wrong date and time on Power Automate Flow
     
    The date's aren't wrong.
     
    (1) SharePoint always stores all dates in UTC (Coordinated Universal Time) time-zone. 
     
    (2) When you enter a date and time into a SharePoint date/time column, SharePoint converts it to UTC before storing it. 
     
    (3)  A ‘Z’ suffix at the end of a date time string indicates UTC (Coordinated Universal Time): 
     
    2024-10-05T08:15Z
     
    (4) SharePoint always stores all dates in UTC regardless of your local time-zone or the SharePoint site’s local time zone settings.
     
    (3) When you VIEW dates in SharePoint, they are displayed according to the site’s Regional settings. For example if your SharePoint site’s Regional Settings are (UTC-08:00) Pacific Time (US and Canada), dates will be displayed in Pacific Time. So a date of 05/10/2024 01:15 Pacific Time (US and Canada) gets stored as 2024-10-05T08:15Z
     
    (4) Power Automate: Dates are read in UTC. To use dates in a local time context, you need to explicitly convert them to the desired time zone. 
     
    If you need to display or use this date in a specific local context, you must convert the UTC value to your desired time zone. This ensures that users see the date and time correctly, based on their local settings.
     

    Here is a Date and Time function you can use:

    Function Task
    convertFromUtc Convert a timestamp from Universal Time Coordinated (UTC) to the target time zone.
    convertFromUtc('2024-12-06T18:00Z', 'Pacific Standard Time', 'dd/MM/yyyy h:mm tt')
    
    06/12/2024 10:00 AM

    For Time Zones, see  Default Time Zones | Microsoft Learn

    Please read the following: 

     
    Ellis

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard