Skip to main content

Notifications

Power Automate - General Discussion
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

 

  • andersonmendoza Profile Picture
    andersonmendoza 9 on at
    Re: PM to AM time conversion in Power Automate

    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.

  • CFernandes Profile Picture
    CFernandes 8,146 on at
    Re: PM to AM time conversion in Power Automate

    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 😊

     

     

     

     

  • PowerSachchin Profile Picture
    PowerSachchin 7 on at
    Re: PM to AM time conversion in Power Automate

     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

  • susan-ng Profile Picture
    susan-ng 22 on at
    Re: PM to AM time conversion in Power Automate

    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
    PowerSachchin 7 on at
    Re: PM to AM time conversion in Power Automate

    @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

     

  • CFernandes Profile Picture
    CFernandes 8,146 on at
    Re: PM to AM time conversion in Power Automate

    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
    PowerSachchin 7 on at
    Re: PM to AM time conversion in Power Automate

    @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
    CFernandes 8,146 on at
    Re: PM to AM time conversion in Power Automate

    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!

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard