Conversion of Time and Date in MS flow

Introduction

We had a requirement where we wanted to create a price list with current date time with respect to current country. In this blog we will use the OOB date conversion functionality.

Use Case : (UTC with )

We created a flow where we had used UTC now functionality but this was returning the value time value with -5.30 hours. After doing RND I come to know that it automatically adjust the time using our time zone. As you can see in the below screen shot.

 

Solution:

To over come with this issue we need to use the inbuilt functionality convertTimeZone.

It takes below parameter

Sr

No

Parameters Example Explanation
1. <timestamp>

 

 

Utcnow() It is a string or function which contains the timestamp
2. <sourceTimeZone>

 

 

 

UTC The name for source time zone .

We can write source time zone which we want to convert into

3. <destinationTimeZone>

 

 

 

India Standard Time The name for the target/destination time zone.

In this case we want to convert UTC into India Standard Time.

So the India Standard Time is a destination TimeZone

 

4. <format>

 

 

dd/MM/yyyy HH:mm

 

Its a format  in this case we wanted to convert into date and time dd/MM/yyyy HH:mm

As you can see in the below screen i have converted UTC to India time zone.

convertTimeZone(utcnow(),’UTC’,’India Standard Time’,’dd/MM/yyyy HH:mm’)

Result:

As you can see in the below screen shot it shows the date time in the mentioned format or you can say indian format.

Conclusion:

Hope this will help you to over come the time zone issue while working with different country time.

 

For more Time Zone conversion refer :

https://docs.microsoft.com/en-us/previous-versions/windows/embedded/gg154758(v=winembedded.80)?redirectedfrom=MSDN




Share Story :