Content migrated from TechNet. Post attribution to: PK Hong
Hi
We used to enter date as: dd/mm/yyyy; Hence, in the InputBox, when I have Today(), it will show mm/dd/yyyy (US Format). I tried using Text(Today(), "dd/mm/yyyy") to force it to change but in vain. Moreover, the date actually displayed in another page after Navigation, show, Date: yyyy-mm-dd and hh:mm:ss. So, I have to use Left(Date, 10) to truncate.
Quite a stupid way. Any suggestion? It always make me in trouble, because any WRONG FORMAT will result in PATCH fails to write into excel file (I spent 20 min to find out this).
TQ
PK Hong
Solved! Go to Solution.
Hi PK,
From the Insert tab, select Text, select Input Text, and rename it to ArrivalDateTime.
Directly in ArrivalDateTime, set default to Today():
Add a label, and set its Text property to the following expression:DateValue(ArrivalDateTime!Text,"fr")
Then the text box will be displayed like dd/mm/yyyy:
Best Regards,
Lisa Chen
Please do not use this technique (use of the function DateValue) for formatting a Date value (i.e., for converting it into a string to be either shown to the user or passed to a connector / service). This may work for some days (like in the example above), but it will most certainly fail in others (as can be seen in this other post). DateValue is used to convert a string into a Date value. If you want to convert a Date (or DateTime) value to a certain text format, use the Text function:
Text(Today(), "dd/mm/yyyy")
Carlos Figueira
Hi PK,
From the Insert tab, select Text, select Input Text, and rename it to ArrivalDateTime.
Directly in ArrivalDateTime, set default to Today():
Add a label, and set its Text property to the following expression:DateValue(ArrivalDateTime!Text,"fr")
Then the text box will be displayed like dd/mm/yyyy:
Best Regards,
Lisa Chen
Hi Lisa
Thanks for clarification. I did before but thought that "en" = dd/mm/yyyy and all European format is mm/dd/yyyy.
Next time, I will try out ALL the choices.
Thanks.
PK Hong
If you try setting the Default property of the Text Input to Text(Today(), "dd/mm/yyyy") that should work, isn't that what you see? Using the Text function is the correct way to display a date in a specific format.
Carlos Figueira
Please do not use this technique (use of the function DateValue) for formatting a Date value (i.e., for converting it into a string to be either shown to the user or passed to a connector / service). This may work for some days (like in the example above), but it will most certainly fail in others (as can be seen in this other post). DateValue is used to convert a string into a Date value. If you want to convert a Date (or DateTime) value to a certain text format, use the Text function:
Text(Today(), "dd/mm/yyyy")
Carlos Figueira
Hi
Initially I used Text(Today(), "dd/mm/yyyy") and change to DateValue as other's advice.
I think I agree with you to switch back to the original setting because NOW, I am facing problem due to all production data uses DATE to sort. If there is anything goes wrong, all the data in mess.
Thanks.
PK Hong
My latest problem is NO Data is Patched when I change the way of data inputting.
My scenario:
1. Data Entry: Use Text(Today(), "dd/mm/yyyy") to capture today's date during and entry and at the same time, enter other data. Then, Patch all of them into defaults(table).
2. When I display the data, I used the same = Text(date, "dd/mm/yyyy") but it appears yyyy-mm-dd.
Very embarrassing.
PK Hong
I don't know why Powerapps uses Retarded format? The whole world is using dd/mm/yyyy. Intuitive and easy. I made many apps and always need this text(Date,"dd/mm/yyyy") workaround. Would it be possible to make it app setting thing? Just asking 😛
This is still a problem for me and no One function seems to works to show a date from a SharePoint List in a proper* format dd MMM yyyy.
I end up using this in a form datacard: Text(DateValue(Text(Parent.Default),"en-GB"), "[$-en-US]dd mmm yyyy")
It seems redundant to have to convert a "Date" value to Text, just to convert it to a DateValue which can eventually be formatted into a custom text format but it works.
*Personal preference: I like this format and consider it proper as there is no ambiguity if the day is less than 13. The user don't have to figure out the date format being used in different apps / environments
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
181 | |
52 | |
41 | |
38 | |
33 |
User | Count |
---|---|
246 | |
80 | |
71 | |
69 | |
66 |