//时间格式化
function formatDate(datevalue, flag) {
var date = new Date(datevalue),
year = date.getFullYear(),
month = date.getMonth() + 1,
day = date.getDate(),
hour = date.getHours(),
minutes = date.getMinutes(),
seconds = date.getSeconds();
var str = year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ?
'0' + day : day);
if (flag) {
str += ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minutes < 10 ? '0' +
minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds)
}
return str;
}
function formatDate(datevalue, flag) {
var date = new Date(datevalue),
year = date.getFullYear(),
month = date.getMonth() + 1,
day = date.getDate(),
hour = date.getHours(),
minutes = date.getMinutes(),
seconds = date.getSeconds();
var str = year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ?
'0' + day : day);
if (flag) {
str += ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minutes < 10 ? '0' +
minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds)
}
return str;
}