2
I have this code:
String dt = "2017-01-04";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
sdf.parse(dt);
} catch (ParseException e) {
e.printStackTrace();
}
But when I use dt , in a method that requires java.util.date , he says dt is not correct because it is a string.
Thank you very much! Just to point out that I needed to do Date data=null;
– Pedro Gouveia