I wrote the following code
Date d = new Date(); CharSequence s = DateFormat.format(\"MMMM d, yyyy \", d.getTime());
But is asking me para
Date c = Calendar.getInstance().getTime(); System.out.println("Current time => " + c); SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); String formattedDate = df.format(c);
This one is the best answer...