Xamarin DatePicker format issue

On one device I got the date format as dd-mm-yyyy while on the other I got mm/dd/yyyy.
But I have declared the format as dd-mm-yyyy. Then why I am getting different format in other device? I want the same format in every device.

How can I get the same date format in different devices?

Answer

I think you should set the CultureInfo first. This is a class provided by .NET and it carries about how the date and number should be displayed referring to info in object from that class. For more info check out the link https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?view=netcore-3.1

Leave a Reply

Your email address will not be published. Required fields are marked *