Here you can find the source of GetDate(String time)
public static Date GetDate(String time)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date GetDate(long milliseconds) { return new Date(milliseconds); }/*ww w. j a v a 2 s . c o m*/ public static Date GetDate(String time) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); try { return sdf.parse(time); } catch (ParseException e) { return new Date(); // e.printStackTrace(); } } }