What to do when converting dates doesn't workOccasionally, app builders attempt to convert dates to different formats using formula that doesn't work. On these occasions, the app produces a random date that's possibly years in the past or future. Alternatively, it may produce a date with missing date parts.
There are generally 2 reasons for this type of failure. The first is that the formula omits the language code in the call to DateValue. An example of this is shown below.
If we don't specify a language code in the call to DateValue, Power Apps applies the language of the user, which is based on the language setting of the device or browser. If the browser language doesn't match the date format of the expected input value, it explains a common situation where the date conversion works for a most users, but fails for a minority of users. Therefore, it is always best to specify an explicit locale (eg, "en-GB", "en-US") when calling the DateValue function.
The second common reason for date conversion failures is confusion over the language code that we pass to the Text function. The language code we pass to the Text function specifies the language of the output format. Where formula specifies both input and output language codes through the DateValue and Text functions, it's easy
for app builders to get these mixed up, which results in a formula that
doesn't work as expected.
To highlight an example of why we would pass a language code to the Text function, here's an example of how we would output the long month name in Spanish.
The screenshot beneath shows the output of this formula.