Its very easy in java to convert String to Date.
Java provides SimpleDateFormat to handle Date related functionality.
Here we call parse() method of SimpleDateFormat.
Example
import java.text.SimpleDateFormat;
import java.util.Date;
public class ChangeStringDate {
public static void main(String[] args)throws Exception {
String stringDate="17/10/2015";
Date dateForm=new SimpleDateFormat("dd/MM/yyyy").parse(stringDate);
System.out.println(stringDate+"\t"+dateForm);
}
}
Output:
17/10/2015 Sat Oct 31 00:00:00 IST 2015
0 Comment(s)