Hi all,
I'm lost in a very simple date format issue that I can't understand. Maybe you can help me looking at it from outside
I have a basic expression to return the month number from today's date:
formatDateTime(utcNow(),'M')
now I expected this to return a number between 1 and 12 (of type string, but still a number), but instead is returning "November 29"
what am I doing wrong?
thanks for help
Solved! Go to Solution.
You can use this expression instead. If you want it as just text (01,02, etc.), you can leave off the int( ).
Pat
To learn more about the Power Platform, follow me on Twitter or subscribe on YouTube.
You can use this expression instead. If you want it as just text (01,02, etc.), you can leave off the int( ).
Pat
To learn more about the Power Platform, follow me on Twitter or subscribe on YouTube.
just to outline, for whomever is having the same issue.
The 'M' notation is reserved for a standard Date Format pre-built by Microsoft, that will return full Month name + Day of month (i.e.: November 29).
therefore, when using a Custom Date Format (like I was trying to achieve) you're not allowed to return month number with a single digit, but you're obliged to use 'MM' notation.
User | Count |
---|---|
89 | |
41 | |
22 | |
20 | |
16 |
User | Count |
---|---|
130 | |
51 | |
48 | |
36 | |
26 |