1.0.1 • Published 3 years ago

bge--tools v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

安装

npm install bge-tools

导入

const m = require('./index')

格式化日期

function dateFormate(dataStr){
    const dt = new Date(dataStr);
    const y = dt.getFullYear();
    const m = addZero(dt.getMonth() + 1)
    const d = addZero(dt.getDate());
    const hh = addZero(dt.getHours());
    const mm = addZero(dt.getMinutes());
    const ss = addZero(dt.getSeconds());
    return `${y}-${m}-${d}  ${hh}:${mm}:${ss}`
}
function addZero(n){
    return n < 10? '0' + n :  n
}

开源协议

lsc

1.0.1

3 years ago

1.0.0

3 years ago