Question

In Control Panel-> Regional and language options-> Regional Options-> Standard and formats, there is the list of all the regionals and by clicking the "Customize" button, the user can set the time format

My question is how to get the current and default time format for all the regionals programmelly?

Was it helpful?

Solution

You can list them through C# like this.

foreach(var cultureInfo in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
    Console.WriteLine("{0}: {1}",
                      cultureInfo.Name,
                      cultureInfo.IsNeutralCulture ? "-" : cultureInfo.DateTimeFormat.ShortDatePattern);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top