如何获取所有地区的时间格式

发布于 2024-09-12 02:18:03 字数 113 浏览 4 评论 0原文

在控制面板->区域和语言选项->区域选项->标准和格式,有所有区域的列表,通过单击“自定义”按钮,用户可以设置时间格式

我的问题是如何以编程方式获取所有区域的当前和默认时间格式?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一袭白衣梦中忆 2024-09-19 02:18:03

您可以像这样通过 C# 列出它们。

foreach(var cultureInfo in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
    Console.WriteLine("{0}: {1}",
                      cultureInfo.Name,
                      cultureInfo.IsNeutralCulture ? "-" : cultureInfo.DateTimeFormat.ShortDatePattern);
}

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);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文