*********获取时间间隔(分钟)
function GetTimeSpan(strTime){
var strTime= "2014-06-16 11:40:00";
return Math.ceil(span);
}
************date->String
function dateToString(date) {
function f(n) {
return n < 10 ? '0' + n : n;
}
return date.getFullYear() + '-' +
f(date.getMonth() + 1) + '-' +
f(date.getDate()) + ' ' +
f(date.getHours()) + ':' +
f(date.getMinutes()) + ':' +
f(date.getSeconds());
};
************str->date
function ymdhms2Date(date) {
//date="20131121210756"
return new Date(date.substring(0, 4) + '-' +
date.substring(4, 6) + '-' +
date.substring(6, 8) + ' ' +
date.substring(8, 10) + ':' +
date.substring(10, 12) + ':' +
date.substring(12, 14));
};