在遇到形如 "2012-12-19T17:00:00Z" 这样的时间字符串时,怎样转换到DateTime类型呢?
View Code
1 string ts = "2012-12-19T17:00:00Z"; 2 DateTime dt2 = DateTime.Parse(ts, null, System.Globalization.DateTimeStyles.RoundtripKind); 3 Console.WriteLine(dt2);