cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Migrated_User
Level 10

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
Level 10

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

Migrated_User
Level 10

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
Migrated_User
Level 10

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

Migrated_User
Level 10

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

Migrated_User
Level 10

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

Migrated_User
Level 10

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

Migrated_User
Level 10

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

Migrated_User
Level 10

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

starwispy
Level: Powered On

Re: Date Format

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

Highlighted
WPB
Level 8

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 194 members 5,049 guests
Please welcome our newest community members: