Here you can find the source of toDate(String date)
public static Date toDate(String date)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date toDate(String date) { return toDate(date, "00:00.00.000"); }//from w w w. j ava2 s .c o m public static Date toDate(String date, String time) { try { return new SimpleDateFormat("dd/MM/yyyy HH:mm").parse(date + " " + time); } catch (ParseException e) { throw new RuntimeException(e); } } }