// 获取当前时间并格式化
export const getNowTime = () => {
    const time = new Date()
    let y = time.getFullYear()
    let m = time.getMonth()+1
    let d = time.getDate()
    let h = time.getHours()
    let mi = time.getMinutes()
    let s = time.getSeconds()
    m = m<10?`0${m}`:m
    d = d<10?`0${d}`:d
    h = h<10?`0${h}`:h
    mi = mi<10?`0${mi}`:mi
    s = s<10?`0${s}`:s
    return `${y}-${m}-${d} ${h}:${mi}:${s}`
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-01-09
  • 2022-12-23
  • 2022-02-09
  • 2021-07-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案