📌  相关文章
📜  在javascript代码示例中获取数据和时间

📅  最后修改于: 2022-03-11 15:03:23.708000             🧑  作者: Mango

代码示例2
const handleTime = (dataD) => {
    let data= new Date(dataD)
    let hrs = data.getHours()
    let mins = data.getMinutes()
    if(hrs<=9)
       hrs = '0' + hrs
    if(mins<10)
      mins = '0' + mins
    const postTime= hrs + ':' + mins
    return postTime
  }