Posts Tagged ‘new java’

Gyrotwister orange

Last nite i am struck in putting date  in the DB and because the date is in string and in DB its Sql date type then now how i convert the string into formate look below……………..



Date dateVar;
SimpleDateFormat sdf = new SimpleDateFormat(“yyyy/MM/dd”);

String DOB=”2012/07/18″;

java.util.Date dt = sdf.parse(DOB);
dateVar = new java.sql.Date(dt.getTime());