• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert date in appropriate format

 
Rahul Dhaware
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out java.text.DateFormat and java.text.SimpleDateFormat. You'll need two of the latter.
 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check it out this link:
DateFormatting
Regards
 
Rahul Dhaware
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob and Ramya.
It works.
 
Vinoth Thirunavukarasu
Ranch Hand
Posts: 164
Android Java Linux
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic