Here you can find the source of parseString2Calendar(String date)
public static Calendar parseString2Calendar(String date) 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 final String PATTERN = "yyyy-MM-dd"; public static Calendar parseString2Calendar(String date, String pattern) throws ParseException { Calendar calendar = Calendar.getInstance(); calendar.setTime(parseString2Date(date, pattern)); return calendar; }/* www . ja v a 2 s.c o m*/ public static Calendar parseString2Calendar(String date) throws ParseException { return parseString2Calendar(date, null); } public static Date parseString2Date(String date, String pattern) throws ParseException { return getSimpleDateFormatInstance(pattern).parse(date); } public static Date parseString2Date(String date) throws ParseException { return parseString2Date(date, null); } private static SimpleDateFormat getSimpleDateFormatInstance(String pattern) { return new SimpleDateFormat(pattern == null ? PATTERN : pattern); } }