I want to compare two date formats and return \"false\" when two formats are not equal.
For example, I get two da
The question is confusing because it asks two separate questions. This is an answer to the second question which asks for a function that will test whether a date string is in the format "yyyy-MM-dd". It uses the DateTime.ParseExact method to test whether the string is in the required format.
Function IsCorrectDateFormat(testDate As String) As Boolean
Dim myDate As DateTime
Return DateTime.TryParseExact(testDate, "yyyy-MM-dd",
System.Globalization.CultureInfo.InvariantCulture,
System.Globalization.DateTimeStyles.None, myDate)
End Function