vb.net - 如何检查当前系统日期格式?

标签 vb.net date-format

如何查看系统日期格式?尝试使用下面的代码,但是当我将系统的日期格式更改为另一种日期格式以测试代码时,它仍然显示更改前的日期格式!

System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern()

最佳答案

好的。我设法找到了解决方案, “当代文化”必须是 'CurrentUICulture' , 而不是 CurrentCulture。如下所示:

System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern()

关于vb.net - 如何检查当前系统日期格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11151188/

相关文章:

c# - 将代码从 VB 转换为 C#

c# - 你会如何简单地 Monitor.TryEnter

vb.net - 如何在VB.Net中将Array转换为ArrayList

c# - 在 ASP.NET MVC 中执行 ListView 的最佳方法?

java - Struts1 输出 util.Date 符合 <html :text> for different Locale 中的特定格式

java - 在 2.3.4 中序列化 DecimalFormatSymbols 时出现问题

java - 在 Java 中使用 String.matches 中的正则表达式来匹配日期格式

c# - DefaultMemberAttribute - 它有什么作用?

asp.net-mvc - jQuery.ui.datepicker 与 Asp.Net MVC dateFormat 映射

php - PHP 中的日期时间格式