I want to convert date from Format 'dd/MM/yyyy' to 'MM/dd/yyyy' and vice-versa
I tried following method for conversion
var val1 = '1/2/2014';
var newDate1 = new Date(val);
alert(newDate1); //returns Thu Jan 02 2014
var val2 = '2/1/2014';
var newDate2 = new Date(val);
alert(newDate2); // returns Sat Feb 01 2014
It is always considering above values in 'MM/dd/yy' format, in one case i need to take date format as 'dd/MM/yy' and convert it to some other
Is it possible to define the 'Date format' of the 'Date' we are going to convert?
Please suggest..