Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
90 views
in Technique[技术] by (71.8m points)

c# - Xamarin DatePicker format issue

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

 How can i get same date format in different devices. 
 [format i declared][1]
 [date format i got in one device][2]
 [date format i got in other device][3]

 [1]: https://i.stack.imgur.com/FXebX.png
 [2]: https://i.stack.imgur.com/OZ7m8.png
 [3]: https://i.stack.imgur.com/JYPgt.png
question from:https://stackoverflow.com/questions/65863397/xamarin-datepicker-format-issue

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...