private string DateTimeTostring(string dateTime)
{
//
dateTime = dateTime.Replace("-","");
//
dateTime = dateTime.Replace(":", "");
//
int pos = dateTime.IndexOf(".");
//
dateTime = dateTime.Substring(0,pos);
return dateTime;
}
private string StringToDateTime(string dateTime)
{
string dateTimeString = string.Empty;
//DateTime d = new DateTime(2008, 3, 6, 19, 54, 14);
//string f = d.ToString("yyyyMMddhhmmss");
//string a = "20080306205914";
DateTime date = DateTime.ParseExact(dateTime, "yyyyMMddHHmmss", null);
dateTimeString = date.ToString("yyyy-MM-dd hh:mm:ss");
return dateTimeString;
}