in the try statement is where i have the problem my imput is a string = "23/03/2003 rossi marco" and my out put needs to be "domenica, 22 marzo 2003" any ideas how i can manage to resolve this problem.
if(stringaRicevuta == null || stringaRicevuta.equals("FINE")){
outVersoClient.writeBytes(stringaRicevuta + " (=>server in chiusura...) " + '\n');
System.out.println("Echo sul server in chiusura :" + stringaRicevuta);
break;
}
else {
//Divisione dell'input
String[] parts = stringaRicevuta.split("( )"); //divide dopo ogni spazio
String toUpperParts1 = parts[1].toUpperCase(); //Rende mauscoli le stringhe
String toUpperParts2 = parts[2].toUpperCase();
String myDateStr=parts[0].toString();
try {
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, Locale.ITALIAN);
Date myDate = dateFormat.parse(myDateStr);
outVersoClient.writeBytes( myDate.toString() + " " + "(ricevuta e ritrasmessa)" + " ");
outVersoClient.writeBytes("Nome e Cognome: " + toUpperParts1 + " " + toUpperParts2 + "\n");
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println("6 Echo sul server : " + stringaRicevuta);
}
}