HighTechTalks DotNet Forums  

how to check a date is valid or not

Dotnet FAQs microsoft.public.dotnet.faqs


Discuss how to check a date is valid or not in the Dotnet FAQs forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Raymond Chiu
 
Posts: n/a

Default how to check a date is valid or not - 10-04-2007 , 04:48 AM






Dear all,

How can I check the date is valid or not?
If I don't use exception handling, is there any way to do?

Thanks for your help,

Mr. Hing



Reply With Quote
  #2  
Old   
Graeme Bradbury
 
Posts: n/a

Default Re: how to check a date is valid or not - 10-04-2007 , 07:18 AM






Are you talking about getting a string representing a datetime and needing
to know if it's valid?
Then DateTime.TryParse(...) is what you're looking for.
http://msdn2.microsoft.com/en-us/lib....tryparse.aspx


"Raymond Chiu" <rchiu2hk (AT) yahoo (DOT) com.hk> wrote

Quote:
Dear all,

How can I check the date is valid or not?
If I don't use exception handling, is there any way to do?

Thanks for your help,

Mr. Hing



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.