Hopefully you will have some spare time to go through this post. Recently I’ve been playing with time fields in Power Automate and it has been a struggle when times in systems don’t match my local time. Calculations often don’t make sense and it is important to offer the user the right time rather than the time used by a system.

Time in Flow

In flows, times are looked at as a text. So there is nothing clever about it. No complicated data structures. Just text!

An example of a time:

2019-09-05T13:43:28.1925648Z

Well this is not very helpful is it? No clue which time zone we are in. But there is help just around the corner. I created the following flow

Convert time zones in Power Automate
Convert time zones in Power Automate

When I ran my flow I found that the Timestamp was one hour out. ( My local time zone the London)

Converting time zones

There is a convertTimeZone function available in Flow.

The function takes 3 parameters.

  • A time
  • A source time zone
  • A destination timezone

The above 3 ingredients is all you need to make time travel happen. Wow, this is easy! Something like the following just simply works:

convertTimeZone(outputs('Compose'),'UTC','GMT Standard Time')

Now you just need to know what all the time zones are called. Luckily Microsoft has documented all the time zones.

 


Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Avatar of Pieter Veenstra

Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There's a better way — and I can show you exactly what it looks like. I'm the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide. For over 30 years I've been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions. You can contact me using contact@sharepains.com

Related Posts

One thought on “Time travel with Power Automate

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains

Subscribe now to keep reading and get access to the full archive.

Continue reading