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.
Solved! Go to Solution.
The formula below works for me, showing dates in UK format, that would otherwise show in US format.
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
Unfortunately for me that didn't work ... I have both set to NZ and still get this:
Nice to know about the regional setting in Chrome though ... was news to me too.
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...
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)
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.
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.
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.
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:
When changed the script I got this:
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.
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:
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
Check it out!
Check it out!
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
The largest Power BI, Power Platform, and Data conference in New Zealand