cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

DateTime picker displays incorrect format for our region

Dates are proving to be challenging and need to be a little bit easier to manage.

 

So I'm fine with using Text(MyDate,"dd/mm/yyyy hh:mm AM/PM") to get them to display correctly, problem is the date picker I can't seem to get that to use the above formula.

 

The date picker always returns and displays as mm/dd/yyyy I have set DateTimeZone to local and I've set the regional setting in SharePoint to New Zealand ... but then I try to use the above formula or something like it the date goes to some random date in the future.

 

Any help would be appreciate, as our production users are getting confused.

 

1 ACCEPTED SOLUTION

Accepted Solutions
MattyH
Level 8

Re: DateTime picker displays incorrect format for our region

The formula below works for me, showing dates in UK format, that would otherwise show in US format.

 

Text(DateTimeValue(Parent.Default),"[$-en-US]dd/mm/yyyy")

View solution in original post

15 REPLIES 15
Meneghino
Level 10

Re: DateTime picker displays incorrect format for our region

Hi @Anonymous  I think I have found a solution for you.

 

Dates are a mess, I agree, but unfortunately they are inherently a mess due to time zones, date formats, UTC for server date/times etc. 

 

Anyway, the date picker control does not have a setting of how to display dates: for display format it takes the regional setting of the system/device or of the browser when displaying the date.  The DateTimeZone property of the date picker does NOT determine how a date is displayed but it determines the time zone of the datetime value returned by the Selected property.

 

So you need to make sure that the system and the browser regional setting are set to NZ.  Thanks to you I discovered that Chrome has a regional setting (in advanced settings), which is set to US by default.  Please see below how it should look to display properly, you need to press the "Display Google Chrome in the language" button.

 

We had the same problem, and this solved it.  For smartphones and tablets the app was displaying fine as the date picker was inheriting the system settings.

 

Please let me know how you get on.

 

PS If you want a datepicker option to start the week on Monday, please vote up this idea

 

__.JPG

Anonymous
Not applicable

Re: DateTime picker displays incorrect format for our region

Unfortunately for me that didn't work ... I have both set to NZ and still get this:

DateSelector.png

Nice to know about the regional setting in Chrome though ... was news to me too.

Meneghino
Level 10

Re: DateTime picker displays incorrect format for our region

Hi again @Anonymous

I am surprised this is not working.

Is it displaying mm/dd/yyyy in all devices or just some?

Could you provide details of device/system?

Maybe NZ is erroneously coded, you could try setting any European country to check...

power2apps
Level: Powered On

Re: DateTime picker displays incorrect format for our region

Hi again @stitch1968,

 

Strange behavior also here. I started first with checking in PowerApps studio and it doesn’t work at first. When I changed Text properties to

 

Text(DateOfTicket.SelectedDate; "[$-en-US]dddd dd mmmm yyyy")

 

It showed formatting date as expected – but still in local settings.  (looks like it is  ignoring language you can insert any here [$-en-US] but does not work without)

Meneghino
Level 10

Re: DateTime picker displays incorrect format for our region

Hi @power2apps

Please be careful, because the Text function can take 1, 2 or 3 parameters.  The second parameter is the format and the optional third parameter is the locale.

The second parameter will include the additional [$-en-US] or whatever, but that seems to be system generated and I think tells it how to interpret the format string (i.e. y is year), but not the locale of the output.  Basically I ignore the [#-xx-XX] piece and always add a third parameter if I want to specify a specifc locale.

Please see the screenshot, which should clarify this.  The output is in Italian.

 

__.JPG

power2apps
Level: Powered On

Re: DateTime picker displays incorrect format for our region

 

Hi @Menegino

 

Yes, looks good,

 

with third parameter we can change local settings and how date is displayed. There is still required some locale settings at second parameter, it is ignored but without any seams that formatting is not working.

 

If I leave to system to generate settings for the beginning of second parameter, it is wrong in my installation. This can cause some inconveniences as this should be corrected manually.

 

Regards

 

Anonymous
Not applicable

Re: DateTime picker displays incorrect format for our region

Will try those suggestions and come back to you.

 

I'm running windows 10 Enterprise Insider Preview, OS.Build 14986.1001 and Chrome Version 56.0.2924.87 (64-bit), on a Toshiba z20t,  but the same happens for all of our users regardless of platform.

Anonymous
Not applicable

Re: DateTime picker displays incorrect format for our region

Ok now things get really weird, I added the following: Text(Parent.Default,"[$-en-US]dd/mm/yyy","it-NZ") and also Tried Text(Parent.Default,"[$-en-US]dd/mm/yyy","it-IT") same result

 

The date was orginally this:

DateSelector3.png

When changed the script I got this:

DateSelector2.png

 

Very strange!

 

Problem with setting the browser and PC/laptop settings would be that I would need to do that to everyone that is using the app. All our OS versions will be set to NZ with group policy and SCCM but Chrome does not have the control, without visiting every machine. Our company supports officiall two browsers Chrome and IE, which does the same.

Meneghino
Level 10

Re: DateTime picker displays incorrect format for our region

Hi again @Anonymous

 

I somewhat understand what is going on.  The date of 2/17/2017 when parsed in the US fashion, gets read as the 2nd day of the 17th month of the year 2017, which is in fact the 2nd day of the 5th month (17-12) of 2018 (2017+1)

I have written to the PowerApps team about this issue in another post:

https://powerusers.microsoft.com/t5/PowerApps-Forum/Bug-report-DateValue-quot-15-15-2016-quot-gives-15-March-2017/m-p/19598

 

The problem seems to be the [$-en-US] piece, what happens if you change to [$-en-GB]?  And apologies, there should be four y's so [$-en-GB]dd/mm/yyyy

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,789)