Here you can find the source of getCalendar(String dateString, String dateTimeFormat, String timeZoneName)
public static Calendar getCalendar(String dateString, String dateTimeFormat, String timeZoneName) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.TimeZone; public class Main { public static Calendar getCalendar(String dateString, String dateTimeFormat, String timeZoneName) throws ParseException { DateFormat dateFormat = new SimpleDateFormat(dateTimeFormat); dateFormat.setTimeZone(TimeZone.getTimeZone(timeZoneName)); Calendar disbursementCalendar = Calendar.getInstance(TimeZone.getTimeZone(timeZoneName)); disbursementCalendar.setTime(dateFormat.parse(dateString)); return disbursementCalendar; }/*from ww w. ja v a 2 s.co m*/ }