I have been passed a date string that looks like this:
Thu%20Mar%2011%202010%2015%3A09%3A11%20GMT%2B0000%20(BST)
I want to compare this date with today's date and hopefully ascertain whether the string above has happened yet. With my limited knowledge of jquery/javascript I wrote this:
var str = new Date("Thu%20Mar%2011%202010%2015%3A09%3A11%20GMT%2B0000%20(BST)");
var date = new Date();
date.setTime(date.getTime());
if (date > str) {
alert('This date has passed');
} else {
alert('This date has NOT passed');
}
However this always returns the second result, even though The date string has definitely passed (it was for about twenty minutes ago as of time of posing). Where am I going wrong