时间:2020-10-18 11:10:45 | 栏目:jquery | 点击:次
如题:
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; }