JSFiddle - React, Tailwind, and code Playground

JavaScript

var todaydate = new Date(); 
var datetime =  todaydate.getMonth()+1  + "-" 
                +todaydate.getDate() + "-"
                + todaydate.getFullYear() + " "  
                + todaydate.getHours() + ":"  
                + todaydate.getMinutes() + ":" 
                + todaydate.getSeconds();
var date2='8-6-2015 15:34:60";
var d1 = new Date(datetime);
var d2=new Date(date2);
alert(("Your Operation took  " + (d2.getTime() - d1.getTime()) + " milliseconds"))
alert(datetime)