Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/06/2015, 07:58
Avatar de giuli956
giuli956
 
Fecha de Ingreso: noviembre-2012
Mensajes: 149
Antigüedad: 12 años, 4 meses
Puntos: 1
Me muestra mal la fecha

Tengo el siguiente metodo en una clase Visor:

Código Java:
Ver original
  1. public static void mostrarFechas(Persona persona){
  2.         String mascara = "dd/MM/yyyy";
  3.  
  4.         SimpleDateFormat sdf = new SimpleDateFormat(mascara);
  5.  
  6.         System.out.println("la persona nacio el:" + sdf.format(persona.getFechaNac()));
  7.    
  8.        
  9.     }

Pero obtengo el año 1969...

Código Java:
Ver original
  1. Visor V1=new Visor();
  2.         V1.mostrarFechas(P1);

P1 es profesor deriva de persona:

Código Java:
Ver original
  1. P1=new Profesor("omar","yañez","DNI",new Date(12/02/2014),(long)35698326,"matematicas",(long)12);