I have a string in the following format.
07/06/2011 5:06
mm/dd/yyyy hh:mm
am using following code
DateFormat dateFormater = new SimpleDateFormat("mm/dd/yyyy hh:mm");
date = (Date)dateFormater.parse(dateTimeStr);
but for input = 03/05/2011 9:45
i get op = Wed Jan 05 09:45:00 IST 2011
Why so?I gave month as march but i am getting jan as month
Whats the issue with my code?
You need to change the format to MM/dd/yyyy hh:mm
ref: http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html