My objective to get the date in day month year format from a textbox and convert it to mm/dd/yyyy format so that i can compare dates
var userDate = document.getElementById("dateOfJourney").value; //eg 21/05/2013
var formattedUserDate = new Date( userDate.replace( /(\d{2})\/(\d{2})\/(\d{4})/, "$2/$1/$3"));
alert(formattedUserDate);
i'm trying to escape 'forward slash' but i'm getting invalid date output eg. 05/21/2013