Time travel with Microsoft Flow

Hopefully you will have some spare time to go through this post. Recently I’ve been playing with time fields in Microsoft Flow 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 flow 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

Time Flow

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.

 

Advertisements

One thought on “Time travel with Microsoft Flow

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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