How to Convert time zone in Power Automate?

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.
power automate convert time zone

Step-2:

Expand the Manually trigger action, and add a Date input to select the date value.

How to Convert time zone in Power Automate

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.
How to Convert time zone in Power Automate flow

Step-4:

See also  Power bi date format (Various examples)

Save and select the trigger date and Run flow by choosing the run flow option.

Example to Convert time zone in Power Automate

Once flow ran successfully. The converted date value is in the convert time zone action outputs.

Example to Convert time zone in Power Automate flow

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.

How to Convert time zone in Power Automate

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')
Power Automate convert time zone expression

Step-3:

Save and choose the trigger date and Run the flow by selecting the Run flow option.

Example to convert time zone expression in Power Automate

Once the flow ran successfully, we can see the converted date value in the convert time zone function outputs.

Example to convert time zone expression in Power Automate flow

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.

See also  6 Various Ways to Sort Array in Power Automate
PatternsPatterns Format
Long date pattern Monday, June 15, 2009 [D]
Short date pattern6/15/2009 [d]
Short time pattern 1:45 PM [t]
Long time pattern1: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 pattern2009-06-15T13:45:30.0000000-07:00 [o]
RFC1123 patternMon, 15 Jun 2009 20:45:30 GMT [r]
Sortable date/time pattern2009-06-15T13:45:30 [s]
Month/day patternJune 15 [m]
Year month patternJune, 2009 [y]
Universal sortable date/time pattern2009-06-15 13:45:30Z [u]
Universal full date/time patternMonday, 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.
Power Automate convert time zone format

Save and select the trigger date and run the flow.

How to convert time zone format in the Power Automate 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.

How to convert time zone format in the Power Automate

Similarly, we will change the Format string pattern to a Short date pattern in the Convert time zone action.

convert time zone format in Power Automate

Save and choose the trigger date and click the run flow option.

How to convert time zone format in Power Automate

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.

How to convert time zone format in Power Automate flow

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.
Power Automate convert time zone custom format

Pass the below expression converts the trigger date with the custom date value format.

formatDateTime(triggerBody()['date'],'yyyy-MMM-dd')
Power Automate flow convert time zone custom format

Save the flow, pick the trigger date, and click the run flow option.

How to convert time zone custom format using flow

Our flow ran successfully. The triggered date selected is converted to the mentioned custom format value of yyyy-MMM-dd.

How to convert time zone custom format using the flow

This is how to convert time zone with a custom format using flow.

See also  The specified object was not found in the store Power Automate

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')
Power Automate convert time zone ddmmyyyy

Save and choose the trigger date and click the run flow option.

convert time zone ddmmyyyy in Power Automate flow

Our flow ran successfully. The triggered date is converted to the mentioned custom format value of dd/mm/yyyy.

convert time zone ddmmyyyy in Power Automate

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')
Power Automate convert time zone utcnow
  • 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.
Example to convert time zone utcnow in Power Automate

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:

>