如题:
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; }