How to format Datetime in Power Automate?

Table of Contents

Working with dates and times is really common for many types of automations. Data often comes in one format but needs to be displayed, stored, or compared in another. That’s when format datetime in Power Automate becomes really important . 

There are basically two ways to format dates or datetime stamps in Power Automate:

Convert time zone action: this is a combination of converting time zone + formatting. If we want to only apply format, both the source and destination time zone can be the same. Time unit will be the final format in which the date will be displayed. This action is not so flexible as directly using the formatDateTime but also be very useful for some scenarios.

Format Date Time function: this lets you transform a datetime value into a specific string format. It’s a very robust and flexible approach as many out-of-the-box
and custom formats can be applied, even considering language. This blog will focus on the use of this PowerFx function.

When we will re-use the formatted date more than once in the workflow it’s recommended to store the formatted date in a variable or compose action, this way we calculate the format only once, and re-use it as many times as required.

What is the formatDateTime function in Power Automate?

The formatDateTime function in Power Automate is used to take a datetime value and return it as a string in the format you specify.

From vision to execution

Whether you're just starting or scaling automation, we help turn your ideas into impactful solutions.

Some examples of when to use include:

  • Display dates in a user-friendly way, for example show August 17, 2025 instead of 2025-08-17T22:30:00Z.
  • Standardize dates before saving them, for example, always store as yyyy-MM-dd).
  • Show dates and/or times in a specific language.

When to use formatDateTime vs convertTimeZone?

The convertTimeZone function is also really useful, but it serves a different purpose: change the datetime value into a different time zone.  formatDateTime to change how the date looks (formatting for emails, file names, etc), convertTimeZone is about changing the actual date/time (from one source datetime stamp to a different one – such as converting UTC to Central America time in El Salvador).

				
					formarDateTime example

formatDateTime(utcNow(), 'dddd, MMMM dd','en-US')

Result: show current UTC datetime in this format: Sunday, August 17.

/////////////////////////////////////////////////////

convertTimeZone example

convertTimeZone(utcNow(), 'UTC', 'Central Standard Time')

Result: convert current UTC datetime to CST time.
				
			

Use formatDateTime to change how the date looks (formatting for emails, file names, etc), convertTimeZone is about changing the actual date/time (from one source datetime stamp to a different one – such as converting UTC to Central America time in El Salvador).

Key parameters: timestamp, format string, locale

The formatDateTime function has three parameters. Two are optional, but knowing all three helps you get exactly the output you want:

 

  1. Timestamp (required)
  • The datetime value you want to format.
  • Can come from built-in functions (utcNow()), dynamic content (like Created date from SharePoint as shown in the screenshot above), or other expressions.
				
					formatDateTime(utcNow(), 'yyyy-MM-dd')
Result:
2025-08-17

				
			
  1. format string (optional)
  • Defines how the datetime should be displayed.
  • If not provided, the function defaults to ISO 8601 format: 2025-08-17T22:30:00Z.
				
					 formatDateTime(utcNow(), 'dddd, MMM dd')
Result:
Sunday, Aug 17

				
			

Some common formats:

Format string

Example output

Meaning

yyyy-MM-dd

8/17/2025

Year-Month-Day

MM/dd/yyyy

8/17/2025

Month/Day/Year (US format)

dd/MM/yyyy

17/08/2025

Day/Month/Year (EU format)

dddd, MMMM dd

Sunday, August 17

Full day + full month name

ddd, MMM dd

Sun, Aug 17

Abbreviated day + abbreviated month

HH:mm

22:30

24-hour time

hh:mm tt

10:30 PM

12-hour time with AM/PM

yyyy-MM-ddTHH:mm:ssZ

2025-08-17T22:30:00Z

ISO 8601 standard

MMMM yyyy

Aug-25

Month + Year

ddd

Sun

Day of week (short)

dddd

Sunday

Day of week (full)

Short format specifiers can be used as well:

 

Format string

Meaning

Example

d

Short date pattern.

6/15/2009

D

Long date pattern

Monday, June 15, 2009

G

General date/time pattern (long
time)

6/15/2009 1:45:30 PM (en-US)

The full list of formats can be found here: https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings

  1. locale (optional)
  • Sets the language and cultural format for the output.
				
					 formatDateTime(
utcNow(),
 	'dddd, MMMM dd',
 	'es-ES'
)
Result:  domingo, agosto 17

				
			

Common locale codes:

en-US → English (United States)

es-ES → Spanish (Spain)

fr-FR → French (France)

de-DE → German (Germany)

Examples using formatDateTime

Format only date (e.g., ‘yyyy-MM-dd’)

Display just the date in a standard numeric format.

				
					formatDateTime(
  outputs('Get_item')?['body/Created'],
  'yyyy-MM-dd'
  )

Output: 2025-08-17

				
			

Format date and time (e.g., ‘MM/dd/yyyy hh:mm tt’)

Show both date and 12-hour time with AM/PM

Using day-of-week or month names (‘dddd’, ‘MMMM’)

				
					formatDateTime(
  outputs('Get_item')?['body/Created'],
  'MM/dd/yyyy hh:mm tt'
  )

				
			

Include full day or month names for a user-friendly display.

				
					formatDateTime(

  outputs('Get_item')?['body/Created'],

  'dddd'

  )

Output: Sunday

/////////////////////////////////////////////////////////////////////////////////

formatDateTime(

  outputs('Get_item')?['body/Created'],

  'MMMM'

  )

Output: August
				
			

Show date format in a specific language.

Use the locale parameter to display the date in another language.

				
					formatDateTime(

  utcNow(),

  'dddd, MMMM dd',

  'es-ES'

  )

Output: domingo, agosto 17
				
			

Dynamic datetime formatting in real-world flows

It’s really common to want to show dates in specific formats when working with Power Automate, for example when we’re saving files in SharePoint, sending emails or requesting an approval.

Naming files or folders with formatted dates

We can pass a dynamic date in the File Name field of a create file action, this way the file will be saved with the date in the format that we specify in the second parameter of the formatDateTime action:

You can also save the results in a compose action or a variable and reference in the following actions.

In this example, we’re using the result of the compose action (which has a formatted date) in the file name:

Is your business ready for automation?

Automate processes with Microsoft Power Platform.

Formatting dates for notifications or approvals

When sending emails, Teams messages, or approval requests, it’s really valuable to include dates in a friendly format.

Dealing with null or empty datetime values

Datetime fields are not always populated. Using formatDateTime on a null or empty value will cause a flow to fail

H3: Null values

				
					Use the coalesce() function to provide a default value if the date is null
formatDateTime(
  coalesce(
    outputs('Get_item')?['body/DueDate'],
    utcNow()
    ),
    'yyyy-MM-dd'
  )
In above example, the expression will check if the column “DueDate” has a value or not, and if null, it will use utcNow datetime stamp. This will prevent the workflow to fail.

//////////////////////////////////////////////////////////////////

Another alternative is to check if the value is null and perform an action based on this:
if(
  equals(
    outputs('Get_item')?['body/DueDate']
    ,null),
    '',
    formatDateTime(
      outputs('Get_item')?['body/DueDate],
      'dddd, MMMM dd yyyy'
      )
)
In above example, if the “DueDate” is null, then the expression will return an empty string (‘’), and if not, it will format the date.

				
			

Get custom Power Automate solutions

Formatting dates and times correctly is just one example of the many actions required when building flows. From handling null values to creating dynamic expressions for , notifications or file creations, we can help your team design and create great workflows. Contact us today and let’s talk about our Power Automate development services can help!

Author
Power Platform Consultant | Business Process Automation Expert
Microsoft Certified Power Platform Consultant and Solution Architect with 4+ years of experience leveraging Power Platform, Microsoft 365, and Azure to continuously discover automation opportunities and re-imagine processes.