Power Automate convertFromUtc() Function

Do you want to convert the time zone to your local time in Power Automate? Then, this tutorial will guide you to achieve your goal!

Here, I will describe the Power Automate convertFromUtc() function and syntax in this Power Automate tutorial. Additionally, I will cover a few more examples of how to use the Power Automate convertFromUtc() function.

Microsoft Power Automate convertFromUtc() function will be useful to convert the UTC zone to the destination timezone.

Power Automate convertFromUtc() Function

When working with different geographical locations globally, converting the timezone to their local time is essential. Usually, Power Automate operates in Coordinated Universal Time (UTC).

The Power Automate convertFromUtc() function is helpful in converting the coordinated universal timezone to the destination timezone.

The return value from this function will give the destination timezone timestamp with the specified format.

This is the overview of the Power Automate convertFromUtc() function.

Power Automate convertFromUtc() Function Syntax

The syntax for the Power Automate convertFromUtc() function is given below.

convertFromUtc('timestamp', 'destinationTimeZone', 'format')

Parameters:

  1. Timestamp: It is a required field where a user can provide a timestamp in UTC that needs to be converted.
  2. Destination Time Zone: A mandatory field in which the timestamp is converted into the targeted timezone.
  3. Format: It is an optional field where a user can provide a custom timestamp format. If not provided, it will take the default format[yyyy-MM-ddTHH:mm: ss.fffffffK].

Example

convertFromUtc(utcNow(), 'India Standard Time','dd-MM-yyyy hh:mm tt' )

Now, Universal Coordinated Time is converted into the India standard timezone. UTC value is 2024-01-03T06:03:56.8584728Z.

Note:

The presence of the uppercase letter Z in the timestamp indicates whether the timezone is UTC or not.

Here, the return value from convertFromUtc() will be 03-01-2024 11:27 AM, which is in India Standard Format.

Microsoft Power Automate convertFromUtc() function

This is how to use the syntax of the Power Automate convertFromUtc() function.

Power Automate convertFromUtc() to Local Time

Here is an example of how the convertFromUtc() function can be utilized in Power Automate.

Example

Let’s assume and take the current date and time in UTC() format. Now, I wanted to convert this time zone to Pacific Standard Time.

  • utcNow() timestamp is = 2024-01-03T04:24:53.7767088Z.
  • Pacific Standard Time will show 02-01-2024 08:24 PM.
convertFromUtc() expression in Power Automate

Follow the step-by-step guide to convertFromTime() to the desired local time zone.

1. Navigate to make.powerautomate.com in the browser to open the Power Automate Home page -> Tap on +Create -> Select Instant cloud flow -> Take Manually trigger a flow and enter a flow name -> Click Create.

2. Next, add an Initialized variable flow action to initialize the utcNow() and set the following details.

  • Name: Give a name for the variable as utcNow().
  • Type: Set data type as ‘String’ from the drop-down.
  • Value: Provide the utcNow() expression as shown below.
utcNow()
Power Automate convertFromUtc() Function

Note:

Different Power Automate Timezones that can be used for conversions.

3. After that, to convert UTC to Pacific Standard Time, add a Compose flow action. Then provide the below information:

  • Inputs: Select the field -> Click Expression -> Give the expression provided in the code below.
convertFromUtc(utcNow(),'Pacific Standard Time','dd-MM-yyyy hh:mm tt')

After that, Select OK.

Power Automate convert from utc to local time

4. At this step, Save and Test the flow manually.

5. After running the flow successfully, you can see that the UTC() timezone is converted into the Pacific Standard Time, as shown below.

  • The result will be like 02-01-2024 08:24 PM.
convertFromUtc() function in Power Automate

Here’s a guide on converting the UTC zone to the destination time zone using Power Automate.

Power Automate convertFromUtc() of Date Variable

Now, I will give you an example of converting the date variable in the UTC format to the destination time zone.

Example

Let’s consider the date variable in the UTC timezone with the format “2024-01-03T08:00:00.0000000Z“. Now, I wanted to convert this timezone to Greenwich Standard Time. Then, the result will be with the specific format and desired timezone, like 03/01/2024T08:00:00.

Power Automate convertFromUtc() Function

To achieve this, Follow the below-mentioned steps:

1. Take an ‘Initialized variable‘ flow action on the Instant cloud flow in Power Automate. Ensure to provide the details for the variable like below:

  • Name: Enter a name for the variable manually as Date.
  • Type: Select the data type as ‘String’ from the drop-down.
  • Value: Provide the value that is given in the below code manually.
2024-01-03T08:00:00.0000000Z
Power Automate convertFromUtc() to destination time zone

2. Next to that, add a Compose flow action. In the Inputs section, provide the expression for the convertFromUtc() function.

  • Inputs: Select the field -> Click Expression -> Insert the expression.
convertFromUtc(variables('Date'),'Greenwich Standard Time','dd/MM/yyyyTHH:mm:ss')

Then, Select OK.

How to use Power Automate convertFromUtc() Function

3. Now, it’s time to Save and Run the flow. Test the flow Manually.

4. After the flow runs successfully, you can see the return value in compose outputs from the convertFromUtc() function in the desired format with the targeted timezone.

  • The result will be Greenwich Standard Time with 03/01/2024T08:00:00 format.
convertFromUtc() Function expression in Power Automate

This is how to convert the date variable in the UTC() time zone to the local time zone using the Power Automate convertFromUtc() function.

Important Key Note:

By default, SharePoint stores date and time values in UTC format. However, you can modify the time zone for date and time values displayed in SharePoint lists and libraries at the site level.

However, the SharePoint list date column values do not have the presence of the uppercase letter Z in the timestamp, which indicates the UTC timezone. So, the Power Automate flow fails and generates an error.

In this case, you can use the convertTimeZone() function to convert the timezone into the targeted timezone.

Conclusion

From this Power Automate tutorial, I have taught you how to convert UTC timezone to local time zone or desired timezone in Power Automate.

Also, I have explained the functionality of the convertFromTime() function and its syntax with various examples.

Moreover, you may like some more Power Automate tutorials: