string
time =
"20140923170000"
;
DateTime dateTime = DateTime.ParseExact(time,
"yyyyMMddHHmmss"
, CultureInfo.CurrentCulture, DateTimeStyles.None);
yyyyMMddHHmmss是指定的数据格式,CultureInfo.CurrentCulture是区域时间格式,DateTimeStyles是时间样式
DateTime dateTime = DateTime.ParseExact(time,
"yyyyMMddHHmmss"
, CultureInfo.CurrentCulture) 也可以