I am trying to print two dates using SimpleDateFormat but for my custom date the output looks completely different.
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
Date date2 =dateFormat.parse("01/01/2014 10:45:01");
System.out.println(("date2:"+date2));
Date date = new Date();
System.out.println(dateFormat.format(date)); // how it prints this is the desired outcome
OUTPUT:
date2:Wed Jan 01 10:45:01 GMT 2014
11/04/2014 10:45:50