Here you can find the source of convertStringToCalendar(String stringDate)
public static Calendar convertStringToCalendar(String stringDate)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import android.util.Log; public class Main { private static String TAG = "DateTimeHelper"; private static String invalidDateFormat = "Invalid date format"; public static Calendar convertStringToCalendar(String stringDate) { SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yy"); Date date = null;// w w w . j a v a2 s. c o m try { date = (Date) formatter.parse(stringDate); } catch (java.text.ParseException e) { Log.w(TAG, invalidDateFormat); } Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar; } }