Answers for "format='DD MMMM YYYY' js"

2

javascript format date yyyy-mm-dd

// yyyy-mm-dd
new Date().toISOString().slice(0, 10)
Posted by: Guest on March-29-2021
1

javascript format date mm/dd/yyyy

function pad2(n) {
  return (n < 10 ? '0' : '') + n;
}

var date = new Date();
var month = pad2(date.getMonth()+1);//months (0-11)
var day = pad2(date.getDate());//day (1-31)
var year= date.getFullYear();

var formattedDate =  month+"/"+day+"/"+year;
alert(formattedDate); //03/02/2021
Posted by: Guest on March-02-2021

Code answers related to "format='DD MMMM YYYY' js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language