This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes String to Date? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String to Date?" Watch "String to Date?" New topic
Author

String to Date?

Jessica James
Ranch Hand

Joined: Jan 23, 2007
Posts: 69
Hi Friends,

How to convert a String to a Date field?
what is the format of String to convert it to date..

Regards,
jessica
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
The java.text.SimpleDateFormat class does this. The code would be something like:

The javadocs for that class list the other possibilities to specify the date and time format.
Jessica James
Ranch Hand

Joined: Jan 23, 2007
Posts: 69
Hi Ulf,

Thanks for your reply..

Regards,
Jessica
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String to Date?