Parse a date
#3

I don't know why people make such functions when all you need is the RegEx plugin and either find the expression online or write it yourself. Date validation is easy in regular expressions.

Код:
^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$
This will match DD/MM/YYYY OR DD.MM.YYYY OR DD-MM-YYYY OR DD.MM/YYYY

Код:
^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$
This expression is the same as above except for MM DD YYYY
Reply


Messages In This Thread
Parse a date - by Urefeu - 26.09.2011, 04:27
Re: Parse a date - by [HiC]TheKiller - 26.09.2011, 05:38
Re: Parse a date - by Ensconce - 26.09.2011, 06:11

Forum Jump:


Users browsing this thread: 2 Guest(s)