标签:nbsp str ret ring rto color style var time
//格式化转时间戳(单位秒) function strtotime(strtime) { strtime = strtime.substring(0, 19); strtime = strtime.replace(/-/g, ‘/‘); strtime = new Date(strtime).getTime() / 1000; return strtime; }
//时间戳(单位秒)转格式化 function getMyDate(str) { str = str * 1000; var oDate = new Date(str), oYear = oDate.getFullYear(), oMonth = oDate.getMonth() + 1, oDay = oDate.getDate(), oHour = oDate.getHours(), oMin = oDate.getMinutes(), oSen = oDate.getSeconds(), oTime = oYear + ‘-‘ + getzf(oMonth) + ‘-‘ + getzf(oDay) + ‘ ‘ + getzf(oHour) + ‘:‘ + getzf(oMin) + ‘:00‘; //最后拼接时间 return oTime; };
标签:nbsp str ret ring rto color style var time
原文地址:https://www.cnblogs.com/huay/p/11684234.html