Power Automate Date & Time – Formatting Options

Power Automate Flow Examples Website Title

This blog post is to show you what characters to use to allow you to change the format of your dates and times.

To use the formatDateTime() function, you need to have a date time, such as that from utcNow() and pass it into the formatDateTime() function. Then you can create your desired date & time output.

An example of this would be formatDateTime(utcNow(), ‘dddd, MMMM dd, yyyy’). This will produce:

Friday, May 07, 2021

If you would like to understand more about how to use the formatDateTime() function on Power Automate then check out the in-depth video by clicking here.

CharacterDescriptionExample
“d”Day of the month1
“dd”Day of the month but includes the initial 001
“ddd”Abbreviated name of the day Fri
“dddd”Full name of the day Friday
“M”Month number5
“MM”Month number but includes the initial 001
“MMM”Abbreviated name of the month Jun
“MMMM”Full name of the monthJune
“y”Year number (last character of the year example using 2021)1
“yy”Year number (last 2 characters of the year example using 2021)21
“yyy”Year number (last 3 characters of the year example using 2021)021
“yyyy”Full year2021
hHour1
hhHour but includes the initial 001
H24 Hour Clock4
HHHour but includes initial 004
mMinute (example: 5)5
mmMinute but includes the initial 005
sSecond7
ssSecond but includes initial 0 07
tAM/PM but only the initial letterA
ttAM/PMAM
“f”The tenths of a second in a date and time value.2009-06-15T13:45:30.6170000 -> 6
“ff”The hundredths of a second in a date and time value.2009-06-15T13:45:30.6170000 -> 61
“fff”The milliseconds in a date and time value.6/15/2009 13:45:30.617 -> 617
“ffff”The ten thousandths of a second in a date and time value.2009-06-15T13:45:30.6175000 -> 6175
“fffff”The hundred thousandths of a second in a date and time value.2009-06-15T13:45:30.6175400 -> 61754
“ffffff”The millionths of a second in a date and time value.2009-06-15T13:45:30.6175420 -> 617542
“fffffff”The ten millionths of a second in a date and time value.2009-06-15T13:45:30.6175425 -> 6175425
“F”If non-zero, the tenths of a second in a date and time value.2009-06-15T13:45:30.6170000 -> 6
“FF”If non-zero, the hundredths of a second in a date and time value.2009-06-15T13:45:30.6170000 -> 61
“FFF”If non-zero, the milliseconds in a date and time value.2009-06-15T13:45:30.6170000 -> 617
“FFFF”If non-zero, the ten thousandths of a second in a date and time value.2009-06-15T13:45:30.5275000 -> 5275
“FFFFF”If non-zero, the hundred thousandths of a second in a date and time value.2009-06-15T13:45:30.6175400 -> 61754
“FFFFFF”If non-zero, the millionths of a second in a date and time value.2009-06-15T13:45:30.6175420 -> 617542
“FFFFFFF”If non-zero, the ten millionths of a second in a date and time value.2009-06-15T13:45:30.6175425 -> 6175425
“g”, “gg”The period or era.2009-06-15T13:45:30.6170000 -> A.D.
“K”Time zone information.2009-06-15T13:45:30, Kind Utc -> Z
“z”Hours offset from UTC, with no leading zeros.2009-06-15T13:45:30-07:00 -> -7
“zz”Hours offset from UTC, with a leading zero for a single-digit value.2009-06-15T13:45:30-07:00 -> -07
“zzz”Hours and minutes offset from UTC.2009-06-15T13:45:30-07:00 -> -07:00
“:”, “.”The time separator.2009-06-15T13:45:30 -> : (en-US)
“/”, “-“The date separator.2009-06-15T13:45:30 -> / (en-US)
“string”, ‘string’Literal string delimiter.2009-06-15T13:45:30 (“arr:” h:m t) -> arr: 1:45 P
%Defines the following character as a custom format specifier.2009-06-15T13:45:30 (%h) -> 1
\The escape character.2009-06-15T13:45:30 (h \h) -> 1 h
Any other characterThe character is copied to the result string unchanged.2009-06-15T01:45:30 (arr hh:mm t) -> arr 01:45 A