js获取当前时间YYYY-mm-dd HH:ii:ss
function getNewFormatDate(){
var date= new Date();
var str='-';
var str1=':';
var month =date.getMonth()+1;
var day = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
date = "0" +date;
}
return date.getFullYear()+str+month+str+date+' '+date.getHours()+str1+date.getMinutes()+str1+date.getSeconds();
}