Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/10/2009, 11:33
Avatar de DiabloGuardian
DiabloGuardian
 
Fecha de Ingreso: noviembre-2008
Ubicación: Hidalgo
Mensajes: 215
Antigüedad: 15 años, 5 meses
Puntos: 3
Respuesta: pasar String a Date

otra forma e convertir un string a Date es usando la clase java.sql.Date

java.sql.Date fecha=java.sql.Date.valueOf(textoFecha);

aun que no se si te interesa guardar la hora o solo la fecha por que esto dice la documentacion de java:

Cita:
valueOf

public static Date valueOf(String s)
Converts a string in JDBC date escape format to a Date value.
Parameters:
s - a String object representing a date in in the format "yyyy-mm-dd"
Returns:
a java.sql.Date object representing the given date
Throws:
IllegalArgumentException - if the date given is not in the JDBC date escape format (yyyy-mm-dd)

saludos
__________________
-=:[ Lo importante no es saber todo, sino saber buscar ]:=-