1.util.js中有关时间的获取: function formatNumber(n){//将小于10的数字,前面加个0进行拼接如:8---08 n = n.toString() //转化成字符串 return n[1]?n:'0'+n //n[1]字符串数据中第2个字符 }