Assuming you're talking about the user entering the data via a form then you should use a DateTimePicker and it will handle all that for you. If you're talking about any old String then you can use the Date.TryParseExact method, which will return True or False if the data passes or fails and, if it passes, will also output the Date value.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.