Hi!! when i save a date 22-Feb-2002(dd-mm-yyyy) from text field into database,it save. but in case of Finding then the format change into 2002-22-2.plz help me to solve this promlem.
posted 14 years ago
Hi, After getting the date from database, do operations on the date data. Like given below-->
String dt=rs.getDate("Fieldname").toString(); //System.out.println("Date "+dt); SimpleDateFormat sdf = new SimpleDateFormat( "MM/dd/yyyy" ); //here date format should be converted to your required format. sdt = sdf.format(dt); //System.out.println("Formatted Date "+sdt);
& then take the String for display purpose. Hope this helps.