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

前端 未结 5 1754
无人及你
无人及你 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:55

    Javascript has Date.parse

    it takes US formatted date of mm/dd/yyyy hh:mm:ss

    alert(new Date(Date.parse("09/10/2011 12:00")))

    will return 10th September 2011 at noon

提交回复
热议问题