C# 14位日期型字符串yyyyMMddHHmmss转变为日期格式
1 DateTime dt = DateTime.ParseExact("20060709110901","yyyyMMddHHmmss", System.Globalization.CultureInfo.CurrentCulture); 2 3 //或者这样 4 5 var ReadyBeginTime = request.PrehotDate.Trim().ConvertToNullableDateTime("yyyyMMddHHmmss"); 6 if (ReadyBeginTime.HasValue) 7 { 8 creating.ReadyBeginTime = ReadyBeginTime.Value; 9 }