Hi All,
I have requirements to check if particular date time has been expired or in past. So I'm using control components in power automate but it seems it's not working for time. I realised it's working fine for dates but I also need to compare time.
Output for below formula is
06/07/2022 06:16 PM
06/07/2022 12:15 AM
So obviously first date is greater than second one but anyhow power automate is not considering AM PM. And it evaluate outcome as false.
If I give both time in PM or AM it works fine.
Any idea how we can achieve it?
Thank you Qingqing Xin, it worked like a charm :)
Hi AnantaYogi,
You can change the time on a 12-hour clock to a time on a 24-hour clock and then compare it.
The entire process is set up as follows:
1.Enter the time you want to compare.
2.Initialize variable
Change the time on a 12-hour clock to a time on a 24-hour clock.
formatDateTime(triggerBody()['text'],'yyyy-MM-ddTHH:mm:ss')
formatDateTime(triggerBody()['text_1'],'yyyy-MM-ddTHH:mm:ss')
3.Add ‘condition’ step. Compare the variables that you just changed.
4.Save and test.
5.The test result is as follows:
It evaluate outcome as true.
Regards,
Qingqing Xin
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156