Tip #1401: Round time in Power Automate

Today’s conversation:

- Hey, wanna see cool way to round time in Power Automate?
- Sure
- *shows the trick*
- Why it's not a tip yet?
- Mmmmm, dunno...

True story.

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:

concat(substring(utcNow(),0,14),'00:00Z')

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.

2 thoughts on “Tip #1401: Round time in Power Automate

  1. JeffeVerde says:

    — ‘Z’ is for ‘Ze UTC Time’, if you must know

    ‘Z’ is for “Zero meridian” (aka “Zulu time” in military and aviation)

Leave a Reply

Your email address will not be published. Required fields are marked *