开发者

How to get the Time format for all the regionals

开发者 https://www.devze.com 2023-01-09 00:40 出处:网络
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 us开发者_C百科er can se

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 us开发者_C百科er can set the time format

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


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);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消