wood burning stoves 2.0*
The moose likes Java in General and the fly likes convert date in appropriate format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "convert date in appropriate format" Watch "convert date in appropriate format" New topic
Author

convert date in appropriate format

Rahul Dhaware
Greenhorn

Joined: Aug 13, 2008
Posts: 22
Hi,
I have a String str ="11/6/08";

and i want to convert it in mysql date format like '2008-11-06'.

How can i do this?

Please help me.

Thanks in advance.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

Check out java.text.DateFormat and java.text.SimpleDateFormat. You'll need two of the latter.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
ramya narayanan
Ranch Hand

Joined: Oct 06, 2008
Posts: 338
Check it out this link:
DateFormatting
Regards
Rahul Dhaware
Greenhorn

Joined: Aug 13, 2008
Posts: 22
Thanks Rob and Ramya.
It works.
Vinoth Thirunavukarasu
Ranch Hand

Joined: Dec 18, 2008
Posts: 164

Hi,
This link will help you.
http://www.hiox.org/bypass/index.php?id=593


Java Best Practices
Linux Best Practices
Amortization Calculator

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: convert date in appropriate format
 
Similar Threads
Problem in SimpleDateFormat
How to change date format yyyy/mm/dd to dd/mm/yyyy
parsing string to date
converting string to date
String conversion