Here you can find the source of parseStringToCalendar(String strDate)
public static Calendar parseStringToCalendar(String strDate)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static Calendar parseStringToCalendar(String strDate) { java.util.Date date = parseStringToUtilDate(strDate); if (date == null) { return null; }//from ww w . ja v a 2 s .co m Calendar ca = Calendar.getInstance(); ca.setTime(date); return ca; } public static java.util.Date parseStringToUtilDate(String strDate) { java.util.Date date = null; try { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); date = df.parse(strDate); } catch (Exception ex) { ex.printStackTrace(); } return date; } }