I have a problem with String conversion to Date Format. Please help me. Below is my code:
String strDate = "23/05/2012"; // Here the format of date is MM/dd/yyyy
Now i want to convert the above String to Date Format like "23 May, 2012".
I am using below code but i am getting value as "Wed May 23 00:00:00 BOT 2012"
String string = "23/05/2012";
Date date = new SimpleDateFormat("MM/dd/yyyy", Locale.ENGLISH).parse(string);
System.out.println(date); // Wed May 23 00:00:00 BOT 2012
How can i get the value as "23 May, 2012". Please help me friends....
SimpleDateFormatand see @UwePlonus' answer. Also, beware in case this matters to you:SimpleDateFormatis not thread safe.