Here you can find the source of strToDate(String strDate, String formator)
public static Calendar strToDate(String strDate, String formator)
//package com.java2s; import java.util.Calendar; public class Main { public static Calendar strToDate(String strDate, String formator) { if (strDate == null || formator == null) { throw new NullPointerException("The arguments are null !"); }/*w w w.ja v a 2 s. co m*/ Calendar date = Calendar.getInstance(); date.setTime(java.sql.Date.valueOf(strDate)); return date; } }