- Hey, wanna see cool way to round time in Power Automate?
- *shows the trick*
- Why it's not a tip yet?
- Mmmmm, dunno...
Sometimes we need to round time in Power Automate. For example, you want to schedule a meeting for tomorrow, at the same time as now. Except “now” could be 11:28 AM and everyone loves meetings scheduled for random times that do not align on 30 minutes.
The trick is to use the simple fact that there is no such thing as date/time data type in Power Automate, it’s all text in a prescribed format. This is the magic expression:
What does it do? It strips the minutes and seconds portion of the string by selecting just the date part and hours and then adds 00:00 as minutes:seconds (or you can add 30:00 if you want to be fancy).
‘Z’ is for ‘Ze UTC Time’, if you must know.
That’s it! Occam’s razor for the win.