[SOLVED] How to validate the DateTime of MM/dd/yyyy hh:mm format?

Issue

I am using MaskedEditExtender for entering a datetime. I am unable to figure out how to validate it.

Is there any Regular Expression for validating dates along with time MM/dd/yyyy hh:mm

or any Javascript function ??

Solution

THis will solve your issue:

^(([0]?[1-9]|1[0-2])/([0-2]?[0-9]|3[0-1])/[1-2]\d{3}) (20|21|22|23|[0-1]?\d{1}):([0-5]?\d{1})$

Answered By – Harun

Answer Checked By – Clifford M. (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *