time validation

  • 12 years ago


    does anyone know how to check if a string is a valid time?  is there any solution that would be culture neutral - i mean i want my time value to be hh:mm all the time.



  • 12 years ago

    I'd recommend using a regular expression to validate a time.

    The MSDN article below shows you how to use regex: 


    In the following site, you can search for a pattern that does time validation.



  • 12 years ago

    thanks, man, great and elegant idea. appreciate it.



Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Weeks of coding can save you hours of planning.”