Posted By

stewshack on 10/14/10


Tagged

csharp


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

Tyster
ovuncgursoy
Priestd09
danfinrud55


isDate in C#


 / Published in: C#
 

URL: http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/dc9ba956-6370-424a-95f5-1b4539c64a66

Here is my function to check if a string is a date in C#.

  1. public bool IsDate(string value)
  2. {
  3. DateTime date;
  4. return DateTime.TryParse(value, out date);
  5. }

Report this snippet  

You need to login to post a comment.