Here you can find the source of parse(String datestring)
public static Calendar parse(String datestring)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { private static final DateFormat DATE_PARSER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static Calendar parse(String datestring) { // Format Date date = new Date(); try {// w w w . j a va 2 s .c o m date = DATE_PARSER.parse(datestring); } catch (ParseException e) { e.printStackTrace(); } Calendar cal = Calendar.getInstance(); cal.setTime(date); return cal; } }