• Post Reply Bookmark Topic Watch Topic
  • New Topic

SimpleDateFormat  RSS feed

 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,

I have a String value ,String date ="2005-05-04"

I need to convert it into this format 04 -May -2005


Please explain to convert like this using SimpleDateFormat..


Thanks in Advance............
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have your read the tutorial: http://java.sun.com/docs/books/tutorial/i18n/format/simpleDateFormat.html
 
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

this is one way:
  • create 2 DateFormats, one for each representation pattern
  • parse the date and then format it: dateFormatTwo.format(dateFormatOne.parse("2005-05-04"))


  • Kai
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!