convert string to date
807597Feb 21 2005 — edited Jun 27 2008Hi,
I pick date values from a table model and want to insert them in a csv file.
the format of dates in the beginig is like : "2004-05-26 00:00:00" . I have to convert it to "26/05/2004" to have values correctly inserted in the file.
I tried :
String temp = Tmodel.getValueAt(i, j).toString();
Date d = String.valueOf(temp);
or directly
d = String.valueOf(Tmodel.getValueAt(i,j));
it didn't work : "incompatible types;found : java.lang.String,required: java.util.Date "
how to correct this, and if possibly any better ideas, it would be great, thanks a lot :)