View Single Post
  #1 (permalink)  
Old 11-05-2007, 10:21 PM
javaplus javaplus is offline
Member
 
Join Date: Nov 2007
Posts: 97
javaplus is on a distinguished road
String to Date conversion
Hi,
I am parsing a text file and have to store the require information into database. The text file is simply an ASCII file. It has date in it which has following format:
YYYY-MON-DD

Example:
2001-jan-12
2006-feb-17

I get date in the form of String and have to store it into Date format. I want a method to be written so I can reuse it later. The sketch of the method is:

Code:
Date strToDate(String date){ ... // code goes here ... Date date = new Date(year,month,day); return date; }
I would be thankful if someone can guide me.

Regards.
Reply With Quote
Sponsored Links