var d = new Date(); var dm = d.getMonth() + 1; var dj = d.getYear(); var dayNr = ((d.getDate()<10) ? "0" : "")+ d.getDate(); var date=dayNr+dm+dj;