Wednesday, December 16, 2015

Get current Date and time in Jquery

function formatDate(date) {

  return date.getMonth()+1 + "" + date.getDate() + "" + date.getFullYear() + "" + date.getHours()+""+ date.getMinutes()+""+date.getSeconds();
}

var d = new Date();
var e = formatDate(d);
alert(e);

No comments:

Post a Comment