So, simply put I made a quick method that returns true if a format provided is a valid for a date time to string representation..
This all seems like it should work to me, and even with some googling I've had no luck.
The method is..
Results(for me) are...Code:Private Function ValidateDateTimeFormat(ByVal format As String) As Boolean Dim dt As DateTime = DateTime.MinValue Dim result As Boolean = False If DateTime.TryParse(format, dt) Then 'Also tried...and TryParseExact as some forum solutions suggested. 'If DateTime.TryParse(format, System.Globalization.CultureInfo.InvariantCulture, Globalization.DateTimeStyles.None, dt) Then result = True End If dt = Nothing Return result End Function
yyyy = False
dddd, MMMM dd, yyyy = False
etc etc..
In all honestly I manually set my condition to true and everything displays fine, just as it should. Only when I replace that True with my method does it always returns false, no matter the format provided.
Thanks in advance
David Carrigan





Reply With Quote
