Here you can find the source of getCalendar(String date)
private static Calendar getCalendar(String date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { private static Calendar getCalendar(String date) { Calendar ret = Calendar.getInstance(); ret.set(Integer.parseInt(date.substring(0, 4)), Integer.parseInt(date.substring(4, 6)) - 1, Integer.parseInt(date.substring(6, 8)), 0, 0, 0); ret.set(Calendar.MILLISECOND, 0); return ret; }//from ww w. j ava 2 s. c om }