Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String conversion

 
reena Mehta
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I want to convert String in to Date format
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the class java.text.SimpleDateFormat to do that - look it up in the API documentation.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Additionally you can check out: JavaDatesFaq. I always keep sharing this link for every String-Date related queries
 
Bobby Smallman
Ranch Hand
Posts: 107
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Swastik Dey
Rancher
Posts: 1603
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As said you can use the SimpleDateFormat class.

Following is a sample code snippet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic