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 / PM to AM time conversi...
Power Automate
Unanswered

PM to AM time conversion in Power Automate

(0) ShareShare
ReportReport
Posted on by 7

Hello Folks,

I have a scenario with SharePoint List where I have to  update a datetime column to Current Date + 1 day with 8:30 AM.

For eg. If today is 1st May then it should update the date time field to 2/5/2021 8:30 AM.

 

I used below formula to start with:

 

 

 

 

formatDateTime(addHours(addDays(utcNow(),1,'dd-MM-yyyy'),8,'dd-MM-yyyy hh:mm:ss tt'),'yyyy-MM-ddTHH:mm:ss')

 

 

 

 

PowerSachchin_0-1619823285717.png

 

PowerSachchin_1-1619823363895.png

In the list, it appears as 8 PM.

 

PowerSachchin_2-1619823468027.png

Any help would be appreciated

 

Categories:
I have the same question (0)
  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @PowerSachchin 

     

    I am not 100% sure if it a timezone issue. but to get 830 you might want to decorate your formula with addMinutes()

     

    addMinutes(formatDateTime(addHours(addDays(utcNow(),1,'dd-MM-yyyy'),8,'dd-MM-yyyy hh:mm:ss tt'),'yyyy-MM-ddTHH:mm:ss'),30,'yyyy-MM-ddTHH:mm:ss')
     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     
  • PowerSachchin Profile Picture
    7 on at

    @CFernandes Thanks for your response, I tried your formula - still is displays time in PM

     

    PowerSachchin_1-1619861402298.png

     

    PowerSachchin_0-1619861331938.png

     

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @PowerSachchin 

     

    I think I understand your problem. Check the regional settings in the Site Collection settings in SharePoint.  SharePoint online normally defaults to whatever timezone the server is in unless you change the regional settings for the site collection.  

     

    In Power Automate the Timezone is UTC. You will need to change it your TimeZome.

     

    CFernandes_0-1619864776960.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • PowerSachchin Profile Picture
    7 on at

    @CFernandes  The Site Collection belongs to NZ

    PowerSachchin_0-1619897256908.png

    Did the conversion from UTC to NZ time zone

    PowerSachchin_1-1619897305864.png

    In the update connector, its returns time in AM

    PowerSachchin_2-1619897389906.png

    However, in the list it appears as PM

    PowerSachchin_3-1619897419645.png

     

  • susan-ng Profile Picture
    22 on at

    The time returned in flow is in UTC, thus when it's updated to Sharepoint, it will be converted to the time zone in your Sharepoint, which is UTC+12. That's why you see PM instead of AM.

  • PowerSachchin Profile Picture
    7 on at

     I tweaked the date with the below formula:

    addMinutes(formatDateTime(addHours(addDays(utcNow(),1,'dd-MM-yyyy'),20,'dd-MM-yyyy hh:mm:ss tt'),'yyyy-MM-ddTHH:mm:ss'),30,'yyyy-MM-ddTHH:mm:ss')

    And removed the conversion connector as the date was again getting converted as per the regional settings defined for Site Collection.

     

    And it worked, here is the output:

    PowerSachchin_0-1620161975055.png

    @CFernandes

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    Hey @PowerSachchin 

     

    So the only difference in the formula is that you added '20' instead of '8'.

     

    CFernandes_1-1620198984646.png

     

     

    I am glad to know that your problem has been resolved 😊

     

     

     

     

  • andersonmendoza Profile Picture
    9 on at

    I had a similar problem. Reading the answer of @CFernandes and In my case I didn't add Minutes else I changed the time format in my expression.

    Original Expression with problem:
    convertTimeZone(items('Aplicar_a_cada_uno')?['FechaProgMantenimiento'],'UTC','SA Pacific Standard Time','yyyy-MM-dd hh:mm:ss')

     

    Fixed Expression:
    convertTimeZone(items('Aplicar_a_cada_uno')?['FechaProgMantenimiento'],'UTC','SA Pacific Standard Time','yyyy-MM-ddTHH:mm:ss')

     

    Look in each expression at the final.

     

    Thanks a lot @CFernandes 

    Sorry my bad english.

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard