How to convert date format using javascript -


this question has answer here:

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); 

jsfiddle


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -