function(timeStr){// 将时间转换成时间轴
var tparams,utcTime,timestamp;
tparams = timeStr.split(/[-\s:]/g);
if(tparams){
if(tparams[1]){// 月份需减1
tparams[1] = tparams[1] - 1;
}
utcTime = new (Function.prototype.bind.apply(Date, [null].concat(tparams)));
timestamp = utcTime.getTime();
}else{
timestamp = new Date().getTime();
}
return timestamp;
}
网友评论