convertToUtc function(Power Automate Cloud flows)
Converts the date and time in a time zone other than Coordinated Universal Time (UTC) to Coordinated Universal Time (UTC).
Function | Source | Destination |
---|---|---|
convertToUtc | Any | Coordinated Universal Time (UTC) |
convertFromUtc | Coordinated Universal Time (UTC) | Any |
convertTimeZone | Any | Any |
This function is used less frequently than other functions of the same type for the following reasons.
- Action and function that retrieve the current date and time should be performed in Coordinated Universal Time (UTC).
- There is little need to convert from another time zone to Coordinated Universal Time (UTC).
Spec
convertToUtc('<timestamp>', '<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. |
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, convertToUtc, and the function name and () will be set in the expression field.
- The first argument. Date and time before conversion
- The second argument. The time zone before conversion.
- The third 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.
As an example, the following equation is executed.
convertToUtc('2022-05-01T14:00:00.0000000', 'Central America Standard Time')
Argument 3 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!