Convert string to DateTime without erroring on fail

	//string MyString = "2000-01-03T13:44:13"
	DateTime MyTimestamp;
	if (DateTime.TryParse(MyString, out MyTimestamp))			//Returns true if conversion sucessful
	{
		//Conversion was sucessful
	}
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *