String To DateTime Conversion In C#

added by DotNetKicks
8/20/2020 3:49:40 PM

551 Views

DateTime.ParseExact(string value, string[] formats, IFormatProvider provider, DateTimeStyles style) The DateTime struct has couple of methods for parsing a string into a DateTime. We will discuss about individual differences: Difference between Parse() and ConvertToDateTime() Both these two methods are almost similar except the following differences: If string value is null then Parse() throws Exception while ConvertToDateTime() returns DateTime.MinValue.


0 comments