What date type? DateTime? A DateTime instance is always a valid date
and time, though it may fall outside of some range you require.
Or do you mean you want to validate a string to verify it represents an
actual date? You could use DateTime.TryParse() to do that, though of
course there are a wide variety of strings that a human could recognize
as a date but which would fail to be parsed. Still, using TryParse()
should give you results useful in a computer program.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.