A java.util.Date
doesn't have a format. It's just a date.
When you print it out, e.g. using toString()
, it uses a default format, which is what you're seeing. But you have that date.
Date dataFrom = new Date();
dataFrom = df.format("14/05/1994");
I don't think that can be your code because DateFormat.format
accepts a Date
and returns a String
, not the other way around. You might mean df.parse
, which would get you the results you describe. But if you take your SimpleDateFormat
and use its format
method on the Date
, then you should get back out 14/05/1994
as you want. A java.util.Date
doesn't have a format, though.