Here you can find the source of getAsCalendar(String dateString)
public static Calendar getAsCalendar(String dateString) throws ParseException
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static SimpleDateFormat df = new SimpleDateFormat( "dd-MM-yyyy HH:mm"); public static Calendar getAsCalendar(String dateString) throws ParseException { Calendar date = Calendar.getInstance(); date.setTime((Date) df.parse(dateString)); return date; }/* ww w .j a v a2 s . c om*/ }