Convert MM/DD/YYYY to DD/MM/YYYY

Pavanandey
Posted by Pavanandey under JavaScript category on | Points: 40 | Views : 1787
function fDate(object)
{
var elm=getObj(object);
var val=elm.value;
var Ary=val.split('/');
var d,m,y;
if(Ary[0].length==1)
d="0"+Ary[0];
if(Ary[1].length==1)
m="0"+Ary[1];
if(Ary[2].length==3)
y=Ary[2]+"0";
if(Ary[2].length==2)
y=Ary[2]+"00";
if(Ary[2].length==1)
y=Ary[2]+"000";
}

Comments or Responses

Login to post response