In this Power Automate tutorial, we will see how to convert time zone in Power Automate with different examples. Also, we will cover the below headings:
- Power Automate convert time zone expression
- Power Automate convert time zone format
- Power Automate convert time zone custom format
- Power Automate convert time zone dd/mm/yyyy
- Power Automate convert time zone utcnow
Scenario:
The flow triggers manually and requests the user to select the trigger date; based on that, we will convert time zones in two different ways. They are,
- Convert time zone (built-in action)
- Convert time zone (Expression)
Follow the headings below to understand how to convert time zones in Power Automate.
Convert time zone in Power Automate
Let us see how to convert the time zone in Power Automate.
Example-1: Convert time zone (built-in action)
Step-1:
- Initially, log in to Power Automate flow using the Microsoft credentials, and select +Create -> instant cloud flow.
- Enter the flow, choose the triggers as Manually trigger a flow and click on the create option.
Step-2:
Expand the Manually trigger action, and add a Date input to select the date value.
Step-3:
Select +New step and add a Convert time zone action from action triggers. Provide the below Parameters:
- Base time: (Required field) Select the DateTime that we want to format
- Source time zone: (Required field) The Source time zone that the date time is currently in.
- Destination time zone: (Required field) The Destination time zone that we want to convert our date to.
- Format String: (Optional field) We can choose any one of the Date formats from the dropdown. It should not be null.
Step-4:
Save and select the trigger date and Run flow by choosing the run flow option.
Once flow ran successfully. The converted date value is in the convert time zone action outputs.
This is how to convert the time zone using Power Automate’s convert time zone action.
Power Automate convert time zone expression
Here we will see how to convert time zones using Power Automate’s convert time zone function expression.
Example-2: Convert time zone (Expression)
Step-1:
Create an instant cloud flow, expand the Manually trigger action, and add a Date input to select the date value.
Step-2: (Add Compose data operation)
We will add the Convert time zone expression, which converts a string timestamp passed in from a source time zone to a target time zone.
Syntax of Convert time zone expression function is
convertTimeZone(timestamp: string, sourceTimeZone: string, destinationTimeZone: string, format?: string)
where,
- convertTimeZone: Function name
- timestamp: (Required field) Select the DateTime that we want to format
- sourceTimeZone:(Required field) The Source time zone the date time is currently in.
- destinationTimeZone:(Required field) The Destination time zone we want to convert our date to.
- format: (optional)The format of the time zone we want to convert our date to.
Add a compose data operation and pass the below convert time zone expression under the expression tab
convertTimeZone(triggerBody()?['Date'],'Eastern Standard Time','Pacific Standard Time','dd-MMM-yyyy')
Step-3:
Save and choose the trigger date and Run the flow by selecting the Run flow option.
Once the flow ran successfully, we can see the converted date value in the convert time zone function outputs.
This is how to convert time zones using the convert time zone function expression in Power Automate.
Power Automate convert time zone format
Let us see how we can convert the time zone format using flow.
By default, 15 different date and time zone format patterns are available in Power Automate flow. The below table represents the Pattern and its format.
Patterns | Patterns Format |
Long date pattern | Monday, June 15, 2009 [D] |
Short date pattern | 6/15/2009 [d] |
Short time pattern | 1:45 PM [t] |
Long time pattern | 1:45:30 PM [T] |
Full date/time pattern (short time) | Monday, June 15, 2009 1:45 PM [f] |
Full date/time pattern (long time) | Monday, June 15, 2009 1:45:30 PM [F] |
General date/time pattern (short time) | 6/15/2009 1:45 PM [g] |
General date/time pattern (long time) | 6/15/2009 1:45:30 PM [G] |
Round-trip date/time pattern | 2009-06-15T13:45:30.0000000-07:00 [o] |
RFC1123 pattern | Mon, 15 Jun 2009 20:45:30 GMT [r] |
Sortable date/time pattern | 2009-06-15T13:45:30 [s] |
Month/day pattern | June 15 [m] |
Year month pattern | June, 2009 [y] |
Universal sortable date/time pattern | 2009-06-15 13:45:30Z [u] |
Universal full date/time pattern | Monday, June 15, 2009 8:45:30 PM [U] |
- Now we will create an instant cloud flow and add a Date input to select the date value.
- Select +New step and add a Convert time zone action from action triggers. Provide the required Parameters, and in the Format string, select the pattern from the dropdown. Here I have selected the Format string pattern as a Long date pattern.
Save and select the trigger date and run the flow.
Once the flow run is successful, we can see the triggered date has been converted and displayed as a long date pattern in the Convert time zone action outputs.
Similarly, we will change the Format string pattern to a Short date pattern in the Convert time zone action.
Save and choose the trigger date and click the run flow option.
Once the flow run is successful, we can see the triggered date has been converted and displayed as a Short date pattern in the Convert time zone action outputs.
This is how to convert the time zone format using Power Automate flow.
Power Automate convert time zone custom format
Let us see how to convert time zone with a custom format using flow.
- Create a button flow, and add a Date input to select the date value.
- Select +New step and add a Convert time zone action from action triggers. Provide the required Parameters in the Format string and select the Enter custom value.
Pass the below expression converts the trigger date with the custom date value format.
formatDateTime(triggerBody()['date'],'yyyy-MMM-dd')
Save the flow, pick the trigger date, and click the run flow option.
Our flow ran successfully. The triggered date selected is converted to the mentioned custom format value of yyyy-MMM-dd.
This is how to convert time zone with a custom format using flow.
Power Automate convert time zone dd/mm/yyyy
Here we will see how to convert time zone by passing a custom format in Power Automate flow.
- Now we will create an instant cloud flow, and add a Date input to select the date value.
- Add a compose data operation and pass the below convert time zone expression with custom date format dd/mm/yyyy.
convertTimeZone(triggerBody()?['Date'],'Eastern Standard Time','Pacific Standard Time','dd/MM/yyyy')
Save and choose the trigger date and click the run flow option.
Our flow ran successfully. The triggered date is converted to the mentioned custom format value of dd/mm/yyyy.
This is how to convert time zone by passing custom values in Power Automate flow.
Power Automate convert time zone utcnow
Here we will see how to convert time zone utcnow in Power Automate flow,
- Create an instant cloud flow. Add a compose data operation and pass the below convert time zone expression under the expression tab.
convertTimeZone(utcNow(),'UTC','Eastern Standard Time','dd-MMMM-yyyy')
- Save and run the flow by selecting the run flow option. Once flow ran successfully.
- The utcnow() returns the current date and is converted to the destination time zone with the mentioned date format in the output of compose data operation.
This is how to convert time zone utcnow in Power Automate flow.
This Power Automate tutorial will show us how to convert time zones in Power Automate with different examples. Also, we will cover the below headings:
- Power Automate convert time zone expression
- Power Automate convert time zone format
- Power Automate convert time zone custom format
- Power Automate convert time zone dd/mm/yyyy
- Power Automate convert time zone utcnow
You may also like:
- How to convert base64 to an image file in Power Automate?
- How to convert string to Date using Power Automate?
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.