Do you need to convert time zone in Power Automate? In this Power Automate tutorial, I will explain how to convert time zone in Power Automate.
Managing time differences is expected in a world where people work in different time zones. This also applies to Power Automate. You may be wondering what time zone Power Automate utilizes as dates and timings are used a lot in your automated operations. The answer is that Power Automate works in Coordinated Universal Time (UTC).
In this tutorial, I will also explain:
- Convert time zone in Power Automate
- Power Automate converttimezone() function
- convertfromutc() function in Power Automate
- converttoutc() function in Power Automate
- Power Automate convert utc to local time
Power Automate convert time zone
Here, we will see how to convert the time zone to the required time zone using the Convert time zone action in Power Automate.
With the Convert time zone action in Power Automate, we can convert the given timestamp from the source time zone to the destination time zone.
So, the Convert time zone action accepts 4 parameters. These are:
- Base time: It is the time that we want to convert.
- Source time zone: It is the time zone of your base time
- Destination time zone: It is the time zone you want to convert
- Format: It is optional. The result time zone will get formatted with the given format.
Now let’s see an example, I have a timestamp ‘2023-11-01T06:43:59.5726039Z’ it is in ‘Coordinated Universal Time’ and we will convert it into timezone i.e. ‘(UTC-05:00) Eastern Time (US & Canada)’.
1. In Power Automate Cloud, create an Instant Cloud Flow and select Manually trigger a flow action.
2. Next we will initialize a string variable and assign a timestamp, you want to convert. For this click on +New step -> select INitialize variable action. Then provide the below information:
- Name: Provide the variable name
- Type: Provide the type as a string
- Value: Provide the value like below
3. Now we will convert the time to another time zone, for this click on the +New step -> select ‘Convert time zone’ action. Then provide the below information
- Base time: Select the timestamp variable from dynamic content
- Source time zone: Select the source time zone
- Destination time zone: Select the destination time zone
- Format: Select the format of the time
4. Now save the flow and run the flow manually, you can see the date and time converted to the destination time zone you have provided.
This is how to convert the date and time from one time zone to another time zone in Power Automate.
converttimezone() in Power Automate
Here, we will see how to convert the time zone to the required time zone using the converttimezone in Power Automate.
The converttimezone () function in Power Automate, is used to convert the timestamp from the source time zone to the destination time zone.
Syntax
convertTimeZone(<timestamp>, <sourceTimeZone>, <destinationTimeZone>, <format>)
Let’s see an example of how we can use the convertTimeZone () function in Power Automate.
For example, I have a timestamp and we will convert the UTC time zone to the Eastern time zone.
1. In Power Automate Cloud, create an Instant Cloud Flow and select Manually trigger a flow action.
2. Next we will initialize a string variable and assign a timestamp, you want to convert. For this click on +New step -> select Initialize variable action. Then provide the below information:
- Name: Provide the variable name
- Type: Provide the type as a string
- Value: Provide the value like below
3. Next, we will convert the timezone, for this click on the +New step -> select Compose action. Then provide the below information
- Inputs: Provide the below expression:
convertTimeZone(variables('timestamp'),'UTC', 'Eastern Standard Time', 'F')
4. Now run the flow manually, and you can see the timestamp we have provided is converted to Eastern Standard Time.
This is how to convert timestamp from one timezone to another timezone in Power Automate using converttimezone() in Power Automate.
convertfromutc function in Power Automate
Here, we will see how we can convert the UTC timestamp to the destination time zone using the convertFromUtc() function in Power Automate.
The convertFromUtc() function in Power Automate converts the UTC timestamp to the destination time zone.
Syntax:
convertFromUtc(<timestamp>, <destinationTimeZone>, <format>)
Let’s see an example of how we can use the convertFromUtc() function in Power Automate.
For example, I have a timestamp ” and we will convert the UTC time zone to the Eastern time zone.
1. In Power Automate Cloud, create an Instant Cloud Flow and select Manually trigger a flow action.
2. Here we will convert UTC to Eastern time zone, so, for this click on +New step -> select Compose action. Then provide the below information:
- Inputs: Provide the below expression:
convertFromUtc(utcNow(), 'Eastern Standard Time','dd-MM-yyyy hh:mm tt' )
3. Now save and run the flow manually, you can see the result below.
This is how to convert UTC time zone to destination time zone Power Automate
convertToUtc() function in Power Automate
Here, we will see how to convert the time zone to UTC time zone in Power Automate.
The Power Automate convertfromutc() converts the timestamp from any timezone to the UTC time zone in Power Automate.
Syntax
convertToUtc(<timestamp>, <sourceTimeZone>, <format>)
For example, I have a timestamp and we will convert the time zone to the Utc time zone in Power Automate.
1. In Power Automate Cloud, create an Instant Cloud Flow and select Manually trigger a flow action.
2. Next we will initialize a string variable and assign a timestamp, you want to convert. For this click on +New step -> select INitialize variable action. Then provide the below information:
- Name: Provide the variable name
- Type: Provide the type as a string
- Value: Provide the value like below
3. Here we will convert the timestamp to Utc, so, for this click on +New step -> select Compose action. Then provide the below information:
- Inputs: Provide the below expression:
convertToUtc(variables('timestamp'),'UTC')
3. Now save and run the flow manually, you can see the result below.
This is how to convert your time zone to UTC time zone in PowerAutomate.
Power Automate converts UTC to local time
Here, we will see how to convert UTC to local time in Power Automate.
For example, we will convert utcNow() to local time in Power Automate. utcNow() will return the current date and time in ISO 8601 format.
1. In Power Automate Cloud, create an Instant Cloud Flow and select Manually trigger a flow action.
2. Now we will convert UTC to local time zone, for this click on Add an action -> select Convert time zone action. Then provide the below information:
- Base time: Provide the below expression
utcNow()
- Source time zone: Select the source time zone
- Destination time zone: Select the destination time zone
- Format: Select the format of the date and time
3. Now run the flow manually and you can see utcNow() is converted to local time in Power Automate.
This is how to convert UTC to local time in Power Automate.
Conclusion
In this Power Automate tutorial, we saw how to use Power Automate convert time zone using convertfromutc() in Power Automate. Also, we covered different topics, these are:
- Power Automate convert time zone action
- Power Automate convertTimeZone function
- convertFromUtc function in Power Automate
- convertToutc() function in Power Automate
- Power Automate convert UTC to local time
You may also like:
- Convert String to GUID in Power Automate
- Convert String to Date in Power Automate
- Convert String to Decimal in Power Automate
- Convert String to Object in Power Automate
- Convert a String to an Array in Power Automate
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com