cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Migrated_User
Solution Sage
Solution Sage

Date Format

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Migrated_User
Solution Sage
Solution Sage

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

View solution in original post

Migrated_User
Solution Sage
Solution Sage

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

View solution in original post

11 REPLIES 11
Migrated_User
Solution Sage
Solution Sage

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

View solution in original post

Migrated_User
Solution Sage
Solution Sage

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

Migrated_User
Solution Sage
Solution Sage

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

Migrated_User
Solution Sage
Solution Sage

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

View solution in original post

Migrated_User
Solution Sage
Solution Sage

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

Migrated_User
Solution Sage
Solution Sage

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

Thanks very much @Migrated_User!  Your formula worked perfectly for me.

 @Migrated_User

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 😛

JacquesOlivier
Helper I
Helper I

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,745)