web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Change date/time forma...
Power Automate
Unanswered

Change date/time format using  formatDateTime without changing time zone

(0) ShareShare
ReportReport
Posted on by 578

I created SharePoint list that when a new item is created it triggers a flow with an approval component. Everything work just fine except that when I try to reformat the date/time for the StartDateTime and EndDateTime columns to a more readable format, the formatDateTime() keeps changing the time zone. For example. I create an event called Mardi Gras - New Orleans. The StartDateTime is 12/20/2022 8:00AM. I enter that date/time in the SharePoint form, and it shows correctly in the list. The issue is that when I trigger the flow with the approval and I try to format the date/time using:

 

 

formatDateTime(triggerOutputs()?['body/StartDateTime'],'MM/dd/yyyy hh:mm tt')

 

 

It adds 6 hours to the time, showing 12/20/2022 2:00PM in the approval notification.

How can I reformat the date/time without changing the time zone? The issue is that today the event is in New Orleans, but Tomorrow, may be in Los Angeles. I can't use "Convert time zone" in flow, because I'll never know what the time zone for the person receiving the invitation or the approval email will be. 

Thanks.

 
Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    on at

    Hi @emfuentes27 ,

     

    I don't believe that the formatDateTime function will change the time.

    SharePoint can set the time zone, and the datetime fetched by Flow will be automatically converted to UTC time.

    Sample:

    This is my sharepoint time zone setting (UTC+8):

    vxiaochenmsft_0-1671591681213.png

    vxiaochenmsft_1-1671591701618.png

    vxiaochenmsft_2-1671591738668.png

    vxiaochenmsft_3-1671591781746.png

     

    You will see the flow shows the UTC datetime.

     

    Best Regards,

    Wearsky

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard