检查以下代码段,
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();
}
}
}
它将输出作为
35年2月22日下午15:33:44
我不明白这怎么可能。35在输出中做了什么
在Hijri中是2015年12月13日,35在Hijry中意味着1435,这是沙特阿拉伯的默认日期格式。
这不是你一年的一部分吗?如果您尝试string.Format(culture, "{0:dd MM yyyy} {0:HH:mm:ss}", testValue);
,您将收到12 02 1435 15:33:44