Problem
Whenever you use one of the below values in Microsoft Flow
- utcNow()
- Time when FLOW was triggered
- Time when email was received
You will get that time in GMT format and not in your local time zone format.
So how do you convert this time in your local timezone.
Note: I am using utcNow and TimeStamp when Flow triggered, storing these values in two variables.
This is how the time stamp get stored in variables when I run the FLOW. Check my system time and the time stamp stored in variables. It has difference of 4 hours, which is GMT time.
Solution
We will use convertTimeZone function to convert GMT to local time zone. We need to pass three required parameters to this function.
- convertTimeZone('<timestamp>', '<sourceTimeZone>', '<destinationTimeZone>', '<format>'?)
Below is an example of what I have used. Instead of utcNow() you can pass your dynamic timestamp field here.
- convertTimeZone(utcNow(),'GMT Standard Time','Arabian Standard Time')
Here is the list of all time zone names which are supported in this function.
Now when I run the FLOW, see the timestamp stored in variables and my local system time stamp matches correctly.
Hope this helps.