date format dd/mm/yyyy hh:mm:ss javascript code example
Example 1: javascript format date yyyy-mm-dd
let today = new Date()
today.toISOString().split('T')[0]
Example 2: javascript date from string dd/mm/yyyy HH mm ss
var d='dd/mm/yy hh:MM:ss';
var d1=d.split(" ");
var date=d1[0].split("/");
var time=d1[1].split(":");
var dd=date[0];
var mm=date[1]-1;
var yy=date[2];
var hh=time[0];
var min=time[1];
var ss=time[2];
var fromdt= new Date("20"+yy,mm-1,dd,hh,min,ss);