日期格式12⼀10⼀2011转换成2011-10-21 寻求帮助,谢谢啦!

2024-12-14 05:46:13
推荐回答(1个)
回答1:

string DateTimeValue = "12/10/2011 12:15:12";
DateTime myDateTime = DateTime.Parse(DateTimeValue);
Console.WriteLine("{0:yyyy-MM-dd}", myDateTime);
输出:2011-12-10