Here is example I am commonly using:
I have a date time string:
var myString = "2015-06-05"
I need to parse it into DateTime variable
var myString = "2015-06-05"; var parsedDateTime = DateTime.ParseExact(myString, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None);