string formatString = "yyyyMMddHHmmss"; string s1 = "20140813200000"; DateTime EnrollDate = DateTime.ParseExact(s1, formatString, null);