Hello, is there a good regex expression that would be able to compare two dates like 3/27/2010 to 3/8/2010 to tell if the first date is greater then the second date?
I'd like to compare using javascript
Hello, is there a good regex expression that would be able to compare two dates like 3/27/2010 to 3/8/2010 to tell if the first date is greater then the second date?
I'd like to compare using javascript
if (new Date("3/27/2010") < new Date("3/8/2010")) {
alert("something's wrong.");
}
It is almost impossible, and completely insane, to do this with a regular expression.
Instead, use Javascript's Date
object:
if (new Date(str1) > new Date(str2))