检查下面的代码片段,
namespace TestDateConvertion
{
class Program
{
static void Main(string[] args)
{
DateTime testValue = new DateTime(2013, 12, 15, 15, 33, 44);
CultureInfo culture = new CultureInfo("ar-SA");
string stringValue = string.Format(culture, "{0:d} {0:HH:mm:ss}", testValue);
Console.WriteLine(stringValue);
Console.ReadLine();
}
}
}
输出为
22/02/35 15:33:44
我不明白这是怎么可能的。 35 在那里输出什么
最佳答案
在回历中是 13/12/2015,35 在回历中表示 1435,这是沙特阿拉伯的默认日期格式。
关于c# - String.format() DateTime 具有阿拉伯文化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17721858/