Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validating a date
Message
De
16/09/2005 09:09:04
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01050107
Message ID:
01050222
Vues:
17
Try one of these regular expressions:

http://www.regexlib.com/Search.aspx?k=datetime

>How to I validate a date?
>
>The user might enter '5/20', from which I create a string of '05/20/05'.
>
>I then convert it to date using:
>
>
>DateTime dDate = Convert.ToDateTime(sDate);
>
>
>But if the user enter2 '55/75', my string would then be '55/75/05' and
>the conversion to date errors.
>
>I want to validate it before I try to convert.
>
>I'm using C#.
>
>Thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform