cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Date formatting - Incorrect Locale

I have a form field, which is autopopulated by the variable 'd1', which is initialized this way:

 

Set(d1,Text( Today(), "[$-en-US]dd mmm yyyy"));

 

 

In most cases, this works nicely, and when the form is submitted (a sharepoint list item is created), I get "28 May 2020" in the date column.

 

However, I noticed that some users set their locale (or something), which messes with this, and instead I end up with "02 6月 2020".  This field is not visible to the user.

 

Questions:

1. Is this the expected behaviour of the Text() function?

  • I had expected that specifying [$-en-US] would have standardized the formatting.

2. Is there anyway to ensure I get the date like this ("28 May 2020") regardless of the user's locale settings?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi @EdwinChua 

This should produce the correct output for you.

Set(d1,Text( Today(), "[$-en-US]dd mmm yyyy", "en-US"));

 

The third argument defines the output locale.

The [$-en-US]  part of this defines the locale of your format string.

View solution in original post

1 REPLY 1
Super User III
Super User III

Hi @EdwinChua 

This should produce the correct output for you.

Set(d1,Text( Today(), "[$-en-US]dd mmm yyyy", "en-US"));

 

The third argument defines the output locale.

The [$-en-US]  part of this defines the locale of your format string.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (48,211)