function calculateDiffTime(){
var nowDate = new Date();
var targetDateStr = "2016-10-25";
var regEx = new RegExp(/-/g);
targetDateStr = targetDateStr .replace(regEx,"/");
var targetDate = new Date(Date.parse(targetDateStr));
//时间差的毫秒数
var milliseconds = nowDate.getTime() - targetDate .getTime();
//计算出相差天数
var days = Math.floor(milliseconds/(24*3600*1000));
}