# java.text.ParseException: Unparseable date: "06 05 2011 12:00:00"
# at java.text.DateFormat.parse(DateFormat.java:337)
# at summerinterndates.Main.contentReading(Main.java:143)
# at summerinterndates.Main.init(Main.java:51)
# at summerinterndates.Main.main(Main.java:290)
From the exception we can see that "06 05 2011 12:00:00" is the string you are trying to format and which is not yyyy-mm-dd. You can use something like this
and you will get "2010-05-06" as output