实现日期小于10补0

// 创建补0函数
function pZone (s) {
   return s < 10 ? '0' + s : s
}

pZone(num)

 

posted @ 2019-01-24 11:13  前端小陌  阅读(416)  评论(0编辑  收藏  举报