function getNow(){
var now = new Date();
//获取当前年
var year = now.getFullYear();
//获取当前月
var month = now.getMonth() + 1;
//获取当前日
var date = now.getDate();
var h = now.getHours(); //获取当前小时数(0-23)
var m = now.getMinutes(); //获取当前分钟数(0-59)
var s = now.getSeconds();
//获取当前时间
var now = year + '-' + conver(month) + "-" + conver(date) + " " + conver(h) + ':' + conver(m) + ":" + conver(s);
return now;
}
function conver(s) {
return s < 10 ? '0' + s : s;
}