cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JosWhite
Advocate II
Advocate II

Text(Today(), DateTimeFormat.ShortDate) reports differently on mobile from desktop

My app uses Text(Today(), DateTimeFormat.ShortDate) to send the text value of today's date to a SharePoint list. When I do this from a web browser on my desktop it reports today as 4/1/2020. When I use the iOS PowerApps app it reports today as April 1, 2020. I really don't care which it reports but why is it not consistent? That is really what I need here.

1 ACCEPTED SOLUTION

Accepted Solutions
MrNappa
Kudo Collector
Kudo Collector

In my experience, this behaviour may be caused by localization of your device/OS/browser. I'm not entirely certain how the end result is determined, though. Even if you specify an explicit language code, it may be overridden or fall back to default. 

 

I think if you use a custom format that only uses numbers (like 'dd mmmm YYYY'), you can get a consistent behaviour.

 

Be wary when using the text options though. For example, in some of my apps I use 'Text(date, "[$-nl-NL]dddd dd mmmm yyyy")' to display a date; but I observed that if my browser language is set to English, it doesn't display the date in Dutch. And if I view it on my device, and the device language is set to English, it also displays the English text.

View solution in original post

2 REPLIES 2
MrNappa
Kudo Collector
Kudo Collector

In my experience, this behaviour may be caused by localization of your device/OS/browser. I'm not entirely certain how the end result is determined, though. Even if you specify an explicit language code, it may be overridden or fall back to default. 

 

I think if you use a custom format that only uses numbers (like 'dd mmmm YYYY'), you can get a consistent behaviour.

 

Be wary when using the text options though. For example, in some of my apps I use 'Text(date, "[$-nl-NL]dddd dd mmmm yyyy")' to display a date; but I observed that if my browser language is set to English, it doesn't display the date in Dutch. And if I view it on my device, and the device language is set to English, it also displays the English text.

This works. It feels a bit more like hard-coding the result, and shouldn't be necessary, but works. Thanks!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (3,091)