PC Review


Reply
Thread Tools Rate Thread

How to determinate if a string is a Date

 
 
ad
Guest
Posts: n/a
 
      16th Jun 2006
How can I determinate if a string is a Valid date.
For example
"2002/06/23", and "2002/6/23" all are valid date string, but "2002/23/06" is
not.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWljaGFlbCBOZW10c2V2?=
Guest
Posts: n/a
 
      16th Jun 2006
Convert.ToDate with regional formate date or use Regexp

> How can I determinate if a string is a Valid date.
> For example
> "2002/06/23", and "2002/6/23" all are valid date string, but "2002/23/06" is
> not.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

 
Reply With Quote
 
Mel
Guest
Posts: n/a
 
      16th Jun 2006
use DateTime.TryParse and it will return a boolean

"ad" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> How can I determinate if a string is a Valid date.
> For example
> "2002/06/23", and "2002/6/23" all are valid date string, but "2002/23/06"
> is not.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date string problem in query string when posting back =?Utf-8?B?SnVsaWEgQg==?= Microsoft ASP .NET 5 29th Aug 2007 03:08 PM
How determinate if there no symbol in a string. ad Microsoft C# .NET 13 16th Dec 2006 07:49 PM
How determinate if there are 2 alphabets in a string at least ad Microsoft C# .NET 2 3rd Dec 2006 07:49 AM
How to determinate if an character in a string ad Microsoft C# .NET 7 3rd Dec 2006 03:30 AM
How to determinate if a string in the Field names of a dataTable? ad Microsoft ADO .NET 1 19th Aug 2006 09:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 PM.