Are you getting the unexpected format of date and time as you expected in a Power Automate Flow? And you need to format the date and time to get what you expected. Here, I will show you how to work with formatdatetime in Power Automate with real examples.
I will show you the following:
- Power Automate formatdatetime() function with syntax.
- How to use formatdatetime function in Power Automate to format date time in Power Automate.
- How to work with utcNow() format in Power Automate.
- List of formats available to use in formatdatetime function in Power Automate
formatdatetime in Power Automate
The formatdatetime function in Power Automate allows you to customize how date and time values are displayed inside a flow.
With the help of this function, you may provide a specific format that will be used to display date and time information regardless of the user’s locale or system preferences. This function returns the date and time in string format.
Let’s first see an example of how a date and time value looks in Power Automate without formatting.

In this Power Automate flow, we first initialize the variable “standarddatetime” and we set the current timestamp utcNow() as value for the variable “standarddatetime” and pass the same to the email body

Without any formatting, the email will look something like this, and it is not in the standard format; also, it is hard to read.
To get a decent or convenient date & time format, we use formatDateTime() function in Power Automate Flow. This is done by passing the DateTime value and formatting style to formatDateTime() function.
The format styles control the visibility and positioning of the month, day, hour, second, etc. of the DateTime value. Let’s understand how to format date and time values in a flow in Power Automate using some examples.
formatdatetime() in Power Automate Syntax
Here is the formatdatetime() in Power Automate syntax.
FormatDateTime(<Timestamp>, <Format>)
In this syntax
- Timestamp: It is the date and time you want to convert to the required format.
- Format: It is the desired format of date and time
Example: I have a timestamp i.e. ‘2023-10-25T13:56:02Z’, and I need to format it to ‘dd-MM-yyyy’, so the result will be 25-10-2023.
Let’s see an example where there is a requirement to display the Date and Time in an email inside a flow using Power Automate. To achieve that, we will use the format style ‘dd/MM/yyyy hh:mm tt‘ in the above function.

So, we are passing the current timestamp as a string parameter and the required formatting style in the function and then setting our variable “standarddatetime” to pass it on in the email body.
Here is the expression:
formatDateTime(utcNow(),'dd/MM/yyyy hh:mm tt')
Once we run the flow, we will receive the below email with the date and time output.

This is how to format date time in Power Automate. Let’s see more such examples of format date time in Power Automate.
How to use formatdatetime function in Power Automate
Here we will see how to use the formatdatetime function in Power Automate with a few examples.
Example 1. Format utcNow() in ‘yyyy-MM-dd’
To get the current date time we will use the function utcNow() which will return today’s date time in ISO 8601 format. Then we will format it to yyyy-MM-dd using formatdate time.
Now let’s see how we can do it in Power Automate.
1. Open Power Automate Cloud, click on +Create select Instant Cloud flow.

Then provide the flow name -> select Manually trigger a flow. Then click on Create.
