How to format date using SimpleDateFormat in Java?

Prompt, please, where is the problem? Date somehow is not formatted...

Need this output:
Ivan Ivanov On 31 12 1987
Bob 15 5 2013

And get this:
Ivan Ivanovich Ivanov Sat Jan 31 00:12:00 PDT 1987
Bob Tue Jan 15 00:05:00 MSK 2013

public class Solution {
 public static final List<person> PEOPLE = new ArrayList<person>();

 public static void main(String[] args) throws IOException, ParseException
{
 BufferedReader br = new BufferedReader(new FileReader(args[0]));
 String line;

 while((line = br.readLine()) != null) {

 String String = line.replaceAll("[a-zA-Zа-za-z]+", "").trim();

 SimpleDateFormat format = new SimpleDateFormat("dd mm yyyy");
 Date Date = format.parse(string);

 String name = line.replaceAll("[\\d]+", "");
 PEOPLE.add(new Person(name, date));
}

 for (int i = 0; i < PEOPLE.size(); i++)
{
 System.out.println(PEOPLE.get(i).getName() + "" + PEOPLE.get(i).getBirthday());
}
}

}</person></person>
July 8th 19 at 11:45
1 answer
July 8th 19 at 11:47
Solution
mm is minutes
MM is months

+ date in the code is never formatted, just parsed.
It is necessary to withdraw the dateFormat.format(date), not date (birthday in code)
with MM clear...
otherwise, if not difficult, can my code example to show where to write? - Brady commented on July 8th 19 at 11:50
: Something like this: pastebin.com/S6WPBXD0 - tamara.Lehner88 commented on July 8th 19 at 11:53
: not compiles...
format.format(PEOPLE.get(i).getBirthday()));
the first format is swearing.. - Brady commented on July 8th 19 at 11:56
: Should be submitted for the cycle
SimpleDateFormat format = new SimpleDateFormat("dd MM yyyy"); - tamara.Lehner88 commented on July 8th 19 at 11:59
: Thank You Very Much!) - Brady commented on July 8th 19 at 12:02

Find more questions by tags Java