A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Java in General
Author
SimpleDateFormat
MInu
Ranch Hand
Joined: Oct 09, 2003
Posts: 517
posted
Feb 13, 2006 12:03:00
0
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
posted
Feb 13, 2006 12:28:00
0
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
posted
Feb 13, 2006 18:06:00
0
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
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter