Tip #1427: Single letter custom formats for dates in Power Automate cloud flows

Today’s tipster is Elaiza “What The Flow” Benitez. (And you can be a tipster too, just send your gem to jar@crmtipoftheday.com!)

“Froyo Queen” Azure McFarlane mentioned in a birdie chat that she was having trouble with formatting the month value using the formatDateTime function in Power Automate cloud flows. She was attempting to only retrieve the month value without the leading 0.

The expression applied was formatDateTime(utcNow(), 'M') but the output returned is the following:

(Problem is that standalone ‘M’ (and bunch of other letters) is not treated as a custom format at all but as one of the standard formats. – t.j.)

Solution: prepend the % character in the expression like this: formatDateTime(utcNow(), '%M')

Ta da!

Special thanks to The Enabler (that’s me ☺️ – t.j) for pointing to the documentation that specifies this.

Another mystery solved! #ScoobyDoo

Cover image by congerdesign | Pixabay

One thought on “Tip #1427: Single letter custom formats for dates in Power Automate cloud flows

  1. zidane says:

    very good information. thank you

Leave a Reply

Your email address will not be published.