I have a simple block of code as follows which takes in a date using SimpleDateFormat, creates a Date object and spits it out textually again
SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/YYYY HH:mm");
Date date = dateformat.parse("23/10/2014 14:00");
System.out.println(date.toString());
I was expecting date.toString()
to spit out a similar representation of the date I'd entered, but instead I this: Mon Dec 30 14:00:00 GMT 2013
which isn't the same date at all as I typed in. (though the time is the same correct.)
What's wrong?