【发布时间】:2011-04-08 03:43:15
【问题描述】:
我在美国英语文化中有字符串说“12/1/2011”我当前的机器文化是英国英国,它是“dd/mm/yyyy”格式。如何将 12/1/2011 转换为 1/12/2011。我尝试了以下格式。
System.DateTime.Parse(result,System.Threading.Thread.CurrentThread.CurrentCulture)
.ToString(System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern)
但我无法看到任何输出。
-洛克什。
【问题讨论】:
-
这能回答你的问题吗? DateTime and CultureInfo
标签: c#