Here you can find the source of timestampToCalendar(String timestamp)
public static Calendar timestampToCalendar(String timestamp)
//package com.java2s; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.TimeZone; public class Main { public static Calendar timestampToCalendar(String timestamp) { GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC")); int year = Integer.parseInt(timestamp.substring(0, 4)); int month = Integer.parseInt(timestamp.substring(4, 6)) - 1; // January == 0! int day = Integer.parseInt(timestamp.substring(6, 8)); int hour = Integer.parseInt(timestamp.substring(8, 10)); int minute = Integer.parseInt(timestamp.substring(10, 12)); int second = Integer.parseInt(timestamp.substring(12, 14)); calendar.set(year, month, day, hour, minute, second); return calendar; }//from w ww . j a v a 2 s . c om }