Here you can find the source of getGregorianCalendar(String yyyymmdd)
public static GregorianCalendar getGregorianCalendar(String yyyymmdd)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static GregorianCalendar getGregorianCalendar(String yyyymmdd) { int yyyy = Integer.parseInt(yyyymmdd.substring(0, 4)); int mm = Integer.parseInt(yyyymmdd.substring(4, 6)); int dd = Integer.parseInt(yyyymmdd.substring(6, 8)); GregorianCalendar calendar = new GregorianCalendar(yyyy, mm - 1, dd, 0, 0, 0); return calendar; }//from w w w . ja va2 s . com }