public static string AssCon(string preinspcode) { IsoDateTimeConverter iso = new IsoDateTimeConverter();//序列化JSON对象时,日期的处理格式 iso.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; DataTable dt = Inspection.AssCon(preinspcode); var json = "[]"; if (dt != null) { json = JsonConvert.SerializeObject(dt, iso); } return(json); }