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

前端 未结 5 1779
无人及你
无人及你 2021-01-06 20:25

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

5条回答
  •  自闭症患者
    2021-01-06 20:59

    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})$
    

提交回复
热议问题