How can I convert String to Date ?

John Zukowski

Look at using the java.text.DateFormat class and its parse() method:

DateFormat dfInput = DateFormat.getDateInstance (
    DateFormat.LONG, Locale.US);
Date inputDate = dfInput.parse(dateString));
Don't forget to catch a potential ParseException.
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.