aspose file tools
The moose likes Java in General and the fly likes SimpleDateFormat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "SimpleDateFormat" Watch "SimpleDateFormat" New topic
Author

SimpleDateFormat

MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
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............


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Have your read the tutorial: http://java.sun.com/docs/books/tutorial/i18n/format/simpleDateFormat.html


There is no emoticon for what I am feeling!
Kai Witte
Ranch Hand

Joined: Jul 17, 2004
Posts: 354
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


    Kai Witte's business website Kai Witte's private homepage Mock exam / preparation kit reviews
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: SimpleDateFormat
     
    Similar Threads
    error in formatting miliseconds for date objects
    Need Help on Time conversion.
    Problem in Coverting one Date Format to Other date Format
    A SimpleDateFormat for ISO 8601
    Convert milliseconds to time