How to convert date format using javascript -
this question has answer here:
- format following date yyyy-mm-dd in js 4 answers
i new javascript, how convert date format('2016/5/6') ('06.05.2015'). want convert in because need manipulate date. ('06.05.2015') format used everywhere.
please suggest me link or tutorial
thanks
var today = new date('2016/5/6'); var dd = today.getdate(); var mm = today.getmonth()+1; //january 0! var yyyy = today.getfullyear(); if(dd<10) { dd='0'+dd } if(mm<10) { mm='0'+mm } today = mm+'.'+dd+'.'+yyyy; alert(today);
Comments
Post a Comment