Text function in Power Apps
The Text function converts any value to a string of text. It can also be used to format date/time value to a string of text.
Power Apps syntax Text(AnyDate, format)
Example: Suppose today the date is Wednesday, 11th Dec 2024. We can see the following power apps formula with the different date-time formats.
a) d The format “d” displays the day as a number without a leading zero from the given data/time value.
Power Apps Formula
The output of the above code is shown below:
b) dd The format “dd”, displays the day as a number with a leading zero when appropriate from the given data/time value.
c) ddd The format “ddd”, displays the weekday as an abbreviation (Sun to Sat) from the given data/time value.
Power Apps Formula
The output of the above code is shown below:
d) dddd The format “dddd”, displays the day as a full name (Sunday to Saturday) from the given data/time value.
Power Apps Formula
The output of the above code is shown below:
e) m The format “m” displays the month from the date/time value as a number without a leading zero from the given data/time value.
Power Apps Formula
The output of the above code is shown below:
f) mm The format “mm” displays the month as a number with a leading zero when appropriate from the given data/time value.
Power Apps Formula
g) mmm The format “mmm” displays the month as an abbreviation (Jan to Dec) from the given data/time value.
Power Apps Formula
The output of the above code is shown below:
h) mmmm The format “mmmm” displays the month as a full name (January to December) from the given data/time value.
Power Apps Formula
The output of the above code is shown below:
i) yy The format “yy” displays the year as a two-digit number from the given data/time value. It returns the last two digits from an year value.
Power Apps Formula
The output of the above code is shown below:
j) yyyy The format “yyyy” displays the year as a four-digit number from the given data/time value.
Power Apps Formula
The output of the above code is shown below: