js计算两个日期的差值

1
2
3
4
// 获取两个比较值的毫秒数<br>var postman_confirmtime_ms = Date.parse(new Date(data.postman_confirmtime.replace(/-/g, "/")));
                    var currentTime_ms=(new Date()).getTime();<br>  //转换成小时比较
                    subtractHour=Math.floor((currentTime_ms-begintime_ms)/1000*3600);
                    console.info(subtractHour);

  http://qiaolevip.iteye.com/blog/1329292

posted @   闲莫等  阅读(2136)  评论(1编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示