1 String 转 DateTime
IFormatProvider formateProvider = new CultureInfo("zh-CN", true);
DateTime dateTime = DateTime.ParseExact(dateTime, "yyyyMMdd", formateProvider)
2 DateTime 转 String
string dateTimeStr = dateTime.ToString("yyyyMMdd");
1 String 转 DateTime
IFormatProvider formateProvider = new CultureInfo("zh-CN", true);
DateTime dateTime = DateTime.ParseExact(dateTime, "yyyyMMdd", formateProvider)
2 DateTime 转 String
string dateTimeStr = dateTime.ToString("yyyyMMdd");