Allora,
ho capito dove è il problema. Poichè dovevo inserire i dati in un DB mysql, mi serviva la notazione della data diversa da quella che da il calendario. Cioè AAAA-MM-GG. Allora ho modificato Questa riga

codice:
function dt2dtstr (dt_datetime) {
	return (new String (
			dt_datetime.getDate()+"-"+(dt_datetime.getMonth()+1)+"-"+dt_datetime.getFullYear()+" "));
}
con questa:

codice:
function dt2dtstr (dt_datetime) {
	return (new String (
			dt_datetime.getFullYear()+"-"+(dt_datetime.getMonth()+1)+"-"+dt_datetime.getDate()+" "));
}
e infatti funziona. Solo per il mese corrente però. Infatti se vado avanti coi mesi ottengo l'errore di cui sopra. Immagino perchè dovrei ambiare la notazione della data un po' dappertutto...Come faccio?