![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
青春燃烧的岁月
开发向架构转型中
展开
-
js 截取字符串,实现标题过长用。。。。代替
//简介字符串截取function infoSub(thisId,needLeng){var id = document.getElementById(thisId);var nowLeng = id.innerHTML.length;if(nowLeng > needLeng){var nowWord = id.innerHTML.substr(0,needLeng)+'..转载 2014-06-12 17:42:29 · 2010 阅读 · 0 评论 -
javascript日期相减,求时间差
//计算时间差var from_date = new Date(from_time);var end_date = new Date(end_time);var time_different = (end_date - from_date) / 86400000; //也就是24*60*60*1000 单位是毫秒/*if(time_different > 365){原创 2014-08-19 14:51:15 · 2481 阅读 · 0 评论 -
js 时间相减判断
例子: var date = new Date(); var current_time = date.getTime(); //当前时间 毫秒 var end_month = date.getMonth() + 1; //当前月 var end_day = date.getDate(); //当前日原创 2015-08-06 15:41:54 · 1247 阅读 · 0 评论