如题:

function nowtime(){//将当前时间转换成yyyymmdd格式
        var mydate = new Date();
        var str = "" + mydate.getFullYear();
        var mm = mydate.getMonth()+1
        if(mydate.getMonth()>9){
          str += mm;
        }
        else{
          str += "0" + mm;
        }
        if(mydate.getDate()>9){
          str += mydate.getDate();
        }
        else{
          str += "0" + mydate.getDate();
        }
        return str;
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2022-02-11
  • 2022-01-09
  • 2021-12-22
  • 2021-08-13
猜你喜欢
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-03-30
相关资源
相似解决方案