Android: Date Format in Month date year

AnnaSmith picture AnnaSmith · May 24, 2012 · Viewed 7.5k times · Source

My date in the application is displaying as 07/10/2011(dd/MM/yyyy)...I want date to be in the format Oct 7,2011 in android coding. Please help as am newbie to Android

Answer

Niko picture Niko · May 24, 2012
    DateFormat f = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.ENGLISH);
    String dateString = f.format(new Date());