errore mio,
quando setti
var data=new Date(dmy[2],dmy[1],dmy[0]);
devi diminuire i mesi di 1
var data=new Date(dmy[2],dmy[1]-1,dmy[0]);

ciao