I have a big problem with a date that I have to formatting in the right way. My proposal of solution following:
...
//Read: 1935-05-12 00:00:00.0
Date dateOfBirth= (Date) arrayOfObject[3];
//Pattern: dd-MM-yyyy hh:mm:ss
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss");
//12-05-1935 12:00:00 (for me it's perfect but I need Date and no String)
String strDate = dateFormat.format(dateOfBirth);
//Read: Sun May 12 00:00:00 CET 1935
dateOfBirth= dateFormat.parse(strDate);
//Read: Sun May 12 00:00:00 CET 1935
rep.setDateOfBirth(dateOfBirth);
...
I need a format like strDate, because I need this format for the database, but I need a Date and not a String and I don't know how can I formatting in the right way my Date string.