Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Getting datetime format from CultureInfo

$
0
0

I need to show some DateTime on a few labels.
I have tried to do this using a ValueConverter, and utilize the CultureInfo object to get the correct format like this:

localDateTime.ToString("g", culture);  //g is format for localized shortformat.

Now, this works perfectly if people have not tampered with the settings on their phones.
People in Denmark, however, tend to often have their phones set to english setup (en-US), and just correct the timezone and timeformat.

Which result in getting me something like 12/31/2015 03:25 PM instead of 31-12-2015 15:25

How do I get the correct format that the user has set, from the phone??? I Assume it is easily accessible somewhere.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>