Here you can find the source of stringToCal(String s, TimeZone tz)
public static Calendar stringToCal(String s, TimeZone tz)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.TimeZone; public class Main { public static Calendar stringToCal(String s, TimeZone tz) { Calendar cal = Calendar.getInstance(tz); cal.set(Calendar.MONTH, Integer.parseInt(s.substring(0, 2)) - 1); cal.set(Calendar.DATE, Integer.parseInt(s.substring(3, 5))); cal.set(Calendar.YEAR, Integer.parseInt(s.substring(6, 10))); return cal; }//from www . j a v a 2 s . co m }