I need an expression which matches,DateTime format (DD/MM/YYYY),i've already found it.
However,it only works to (1/6/2009) or (1/5/2010),it doenst support (01/06/2009) or (01/05/2010).
How can i check if a string is a dateTime in Javascript?
I need an expression which matches,DateTime format (DD/MM/YYYY),i've already found it.
However,it only works to (1/6/2009) or (1/5/2010),it doenst support (01/06/2009) or (01/05/2010).
How can i check if a string is a dateTime in Javascript?
Try this (which I found here):
(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d
In order to make this match dates without leading zeros on the month and the day you will need to change it up a bit:
(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d