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')
In the list, it appears as 8 PM.
Any help would be appreciated
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.
Hey @PowerSachchin
So the only difference in the formula is that you added '20' instead of '8'.
I am glad to know that your problem has been resolved 😊
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:
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.
@CFernandes The Site Collection belongs to NZ
Did the conversion from UTC to NZ time zone
In the update connector, its returns time in AM
However, in the list it appears as PM
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.
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!
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()
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!