Java - String a Fecha con SimpleDateFormat

 
Vista:

String a Fecha con SimpleDateFormat

Publicado por Manuel Rivera (1 intervención) el 29/04/2012 02:37:30
Hola foro espero me puedan ayudar quiero tranformar un string a fecha

1
2
3
4
5
6
7
8
9
cfecha = "28/04/2012"
SimpleDateFormat formatoFecha = new SimpleDateFormat("dd/MM/yyyy");
Date dFecha = null;
try {
dFecha= formatoFecha.parse(cfecha);
}
catch (ParseException ex) {
Logger.getLogger(ServletContratoFrm.class.getName()).log(Level.SEVERE, null, ex);
}

resulta que fecha me devuelve el resultado :
Sat apr 28 00:00:00 COT 2012

y yo necesito guardar la fecha como 28/04/2012

Espero su ayuda

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder