File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes String conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String conversion" Watch "String conversion" New topic

String conversion

reena Mehta

Joined: Nov 17, 2010
Posts: 24

I want to convert String in to Date format
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15082

You can use the class java.text.SimpleDateFormat to do that - look it up in the API documentation.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3152

Additionally you can check out: JavaDatesFaq. I always keep sharing this link for every String-Date related queries

Mohamed Sanaulla | My Blog
Bobby Smallman
Ranch Hand

Joined: Sep 09, 2010
Posts: 107
When in doubt, check the API. Not only will it help you become to have a better understanding of Java but going through the API yourself is definitely faster than waiting for responses on a forum (even if the Ranch has incredibly fast responses!). Good luck to you!

Everyday in every way, we get a little better.
Swastik Dey

Joined: Jan 08, 2009
Posts: 1584

As said you can use the SimpleDateFormat class.

Following is a sample code snippet

I agree. Here's the link:
subject: String conversion
It's not a secret anymore!