如题
字符串:20160403020600000-0700
转为东八区日期时间型字段
参考代码
IFormatProvider ifp = new CultureInfo("zh-CHS", true); DateTime dtmTemp = DateTime.ParseExact(sTimeNew, "yyyyMMddHHmmssfff", ifp);
IFormatProvider ifp = new CultureInfo("zh-CHS", true);
这句会把时间转为本地时间
DateTime dateTime = DateTime.ParseExact(timeString, "yyyyMMddHHmmssfffzz00" , new CultureInfo("zh-CHS", true));
大神