Here you can find the source of stringToCalendar(String date)
public static Calendar stringToCalendar(String date)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static Calendar stringToCalendar(String date) { Calendar calendar = Calendar.getInstance(); SimpleDateFormat dateformatter = new SimpleDateFormat( "dd/MM/yyyy HH:mm:ss"); try {/* ww w . j av a2 s . co m*/ calendar.setTime(dateformatter.parse(date)); } catch (ParseException e) { e.printStackTrace(); } return calendar; } }