string date = "4/20/2011 8:17"; Convert.ToDateTime(date); and DateTime.ParseExact(date,"M/dd/yyy",System.Globalization.CultureInfo.CurrentCulture);
CultureInfo provider = CultureInfo.InvariantCulture; string date = "04/20/2011 08:17"; DateTime dt1 = DateTime.ParseExact(date, "g",provider);
string strDateTime = "2/28/1992 12:15:12"; DateTime myDateTime = DateTime.Parse(strDateTime ); Or myDate = DateTime.ParseExact("2009-05-08 14:40:52,531", "yyyy-MM-dd HH:mm:ss,fff",System.Globalization.CultureInfo.InvariantCulture)
Convert.ToDateTime
ParseExact
"M/dd/yyyy h:mm"
string d="04/20/2011"; datetime d1=convert.todatetime(d);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)