Click here to Skip to main content
16,012,759 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to check a string "dd/mm/yyyy" contains d,m,y....
i want to display true for "dd/mm/yyyy" and false for "dd/mm"
Posted
Comments
harikrishnanmb 21-Aug-13 3:22am    
thank you....but i want to check not the date format "dd/mm/yyyy" is a string

Try:
VB
Dim dt As DateTime
If DateTime.TryParseExact(myDateString, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, dt) Then
    ' All ok.
End If
 
Share this answer
 
Comments
harikrishnanmb 21-Aug-13 3:45am    
thank you friend...
OriginalGriff 21-Aug-13 4:26am    
You're welcome!
I would suggest you to use RegEx[^] with date pattern[^].
 
Share this answer
 
Comments
harikrishnanmb 21-Aug-13 3:45am    
thanks
Maciej Los 21-Aug-13 3:59am    
You're welcome ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900