is there a faster way to check if this is a valid date ?

Posted by ooo on Stack Overflow See other posts from Stack Overflow or by ooo
Published on 2010-05-17T13:06:09Z Indexed on 2010/05/17 13:10 UTC
Read the original article Hit count: 118

Filed under:
|

is there a faster way then to simply catch an exception like below:

try
        {
            date = new DateTime(model_.Date.Year, model_.Date.Month, (7 * multiplier) + (7 - dow) + 2);
        }
        catch (Exception)
        {
             //This is an invalid date
         }

© Stack Overflow or respective owner

Related posts about c#

Related posts about datetime