I have written a small app which converts day number (1-366) to actual date and vice-versa. It works OK, so I started to think what would happen if the user types an invalid date (29/02/2010 or 33/09/2010 etc) and how do I detect this.
If I do a DateDiff on the input date, I can throw and trap these errors. Great.
But this seems like a bodge to me. After all I'm not interested in the output from the DateDiff.
I was wondering how other people would go about detecting this type of error, without having to code every eventuality?
Steve
If I do a DateDiff on the input date, I can throw and trap these errors. Great.
But this seems like a bodge to me. After all I'm not interested in the output from the DateDiff.
I was wondering how other people would go about detecting this type of error, without having to code every eventuality?
Steve