标签:
function readTimeTicks(time){ if(time === 0) return ‘‘; var d = 0, h = 0, m = 0, s = 0; d = parseInt(time / (24 * 3600 * 100)); time = d > 0 ? time % (24 * 3600 * 100) : time; h = parseInt(time / (3600 * 100)); time = h > 0 ? time % (3600 * 100) : time; m = parseInt(time / 6000); time = m > 0 ? time % 6000 : time; s = parseInt(time / 100); time = s > 0 ? time % 100 : time; if(h < 10) h = ‘0‘ + h; if(m < 10) m = ‘0‘ + m; if(s < 10) s = ‘0‘ + s; if(d > 0){ d = d + ‘天 ‘; }else{ d = ‘‘; } return `${d}${h}:${m}:${s}`; }
并在readVarbinds函数的type == ObjectType.TimeTicks的逻辑判断里添加
value = readTimeTicks(value);
标签:
原文地址:http://www.cnblogs.com/zh33gl/p/4968580.html