cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Solution Sage
Solution Sage

Re: Date Format

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

Highlighted
Solution Sage
Solution Sage

Re: Date Format

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

8 REPLIES 8
Highlighted
Solution Sage
Solution Sage

Re: Date Format

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

Highlighted
Solution Sage
Solution Sage

Re: Date Format

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

Highlighted
Solution Sage
Solution Sage

Re: Date Format

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

Highlighted
Solution Sage
Solution Sage

Re: Date Format

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

Highlighted
Solution Sage
Solution Sage

Re: Date Format

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

Highlighted
Solution Sage
Solution Sage

Re: Date Format

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

Highlighted
Kudo Collector
Kudo Collector

Re: Date Format

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

Highlighted
Kudo Commander
Kudo Commander

Re: Date Format

 @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 😛

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,684)