Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating a date
Message
From
16/09/2005 04:24:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01050107
Message ID:
01050165
Views:
9
>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

Kevin,
I think you missed my last reply to your previous question.
Re: ASCII Value of a character Thread #1049249 Message #1049521
Remove "1/1/2000 " prefix there to validate a date. Parse checks for different representations of a date.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform