I want to show a date string in this format: Jun 27, 2012
. I did this:
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyy");
String date = sdf.format(Calendar.getInstance());
But it gives me this:
java.lang.IllegalArgumentException: Cannot format given Object as a Date
What am I doing wrong?