convertTimeZone function(Power Automate Cloud flows)
convertTimeZone is a function used in Power Automate expressions, It converts a date and time in Coordinated Universal Time (UTC) to a specified time zone.
This is similar to the Convert time zone.
Function | Source | Destination |
---|---|---|
convertTimeZone | Any | Any |
convertFromUtc | Coordinated Universal Time (UTC) | Any |
convertToUtc | Any | Coordinated Universal Time (UTC) |
Depending on the locale, it may be more efficient to use the convertFromUtc function to convert from Coordinated Universal Time (UTC) to another time zone.
This is the most common use since the result of getting the current time is in Coordinated Universal Time (UTC).
The convertTimeZone function is primarily used to convert from a time zone other than Coordinated Universal Time (UTC) to another time zone other than Coordinated Universal Time (UTC).
Spec
convertTimeZone('<timestamp>', '<sourceTimeZone>', '<destinationTimeZone>', '<format>')
Argument | Default | Description |
---|---|---|
timestamp | Required field | Specifies the date of the conversion source. Specify in the format to be obtained by the current time action or utcNow function (format unspecified). Any format other than "yyyy-MM-ddTHH:mm:ss.fffffffK" will result in an error. |
sourceTimeZone | Required field | Specifies the time zone before conversion. |
destinationTimeZone | Required field | Specifies the time zone after conversion. |
format | yyyy-MM-ddTHH:mm:ss.fffffffK | Specifies the format of the result. If not specified, the format is "yyyy-MM-ddTHH:mm:ss.fffffffK" as well as "timestamp". |
How to use
In most cases, it is used in the "value" when initializing or setting variables of type "string".
Click on the "Expression" tab, convertTimeZone, and the function name and () will be set in the expression field.
Specify arguments.
- The first argument. Date and time before conversion
- The second argument. The time zone of the conversion source.
- The third argument. The time zone after conversion.
- The fourth argument. Specifies the format of the result.
When using dynamic content or variables, special specifications are required.
Click on the button, and if the display looks like the following, the setting is complete.
You can change the function by clicking this purple icon.
For example, "convertTimeZone('2022-05-01T14:00:00.0000000Z', 'UTC','Central America Standard Time')" the result will be January 1, 2022 at 8:00.
Argument 4 is an optional item. This item specifies the format after conversion.
If omitted, the format is the same as timestamp.
This is the same format as the result of the "Current time" action or the utcNow function (format not specified).
For those who want to learn Power Automate Cloud flow effectively
The information on this site is now available in an easy-to-read e-book format.
Or Kindle Unlimited (unlimited reading).
You willl discover how to about basic operations.
By the end of this book, you will be equipped with the knowledge you need to use Power Automate Cloud flow to streamline your workflow.
Discussion
New Comments
No comments yet. Be the first one!