-4

I have java.util.Date 02/26/2015. I want to convert it like Feburary 26,2015 as String. How can I convert it like that ??

like what goes here ??

DateFormat formatter = new SimpleDateFormat("here");
Junaid
  • 2,572
  • 6
  • 41
  • 77
  • 1
    Use DateFormatter and format. – Juned Ahsan Feb 26 '15 at 07:02
  • Yeah but what should be the formate ?? like what goes here ?? `DateFormat formatter = new SimpleDateFormat("here");` – Junaid Feb 26 '15 at 07:05
  • 2
    Have you read the docs? – isnot2bad Feb 26 '15 at 07:06
  • SO should automatically close such questions. – Chetan Kinger Feb 26 '15 at 07:11
  • The duplicate you've suggested is *not* a duplicate - it's going the other way. But there *are* lots of duplicates... and as isnot2bad says, the documentation is reasonably clear. Did you read the docs for `SimpleDateFormat` before asking? SO is not an alternative to research - it should be where you turn *after* researching the problem thoroughly. – Jon Skeet Feb 26 '15 at 07:15

3 Answers3

1

Use this format:

DateFormat formatter = new SimpleDateFormat("EEE dd,yyyy");

As descripted in the documentation of SimpleDateFormat:

E Day name in week
d Day in month
y Year

Jens
  • 67,715
  • 15
  • 98
  • 113
1

You use SimpleDateFormat

DateFormat formatter = new SimpleDateFormat("MMMM dd,  yyyy");

The format above is:

MMMM Month in year,
dd Day in month,
yyyy Year,

Please read the manual for more possibilities of how to format dates properly.

Jamie Reid
  • 532
  • 2
  • 17
-1
SimpleDateFormat format=new SimpleDateFormat("MMMM dd,  yyyy");