Here you can find the source of getCalendarForTimeZone(final String timeZone)
Parameter | Description |
---|---|
timeZone | the time zone |
Parameter | Description |
---|---|
ParseException | the parse exception |
public static Calendar getCalendarForTimeZone(final String timeZone) throws ParseException
//package com.java2s; /*/*from w w w . jav a2 s.c o m*/ * DateUtil.java * Copyright (c) 2014, CODEROAD, All Rights Reserved. * * This software is the confidential and proprietary information of CODEROAD * ("Confidential Information"). You shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement you entered into with * CODEROAD. */ import java.text.ParseException; import java.util.Calendar; import java.util.Locale; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; public class Main { /** * Gets the calendar for time zone. * * @param timeZone the time zone * @return the calendar for time zone * @throws ParseException the parse exception */ public static Calendar getCalendarForTimeZone(final String timeZone) throws ParseException { DateTime dateTime = new DateTime(DateTimeZone.forID(timeZone)); Calendar tzCalendar = dateTime.toCalendar(Locale.ENGLISH); return tzCalendar; } }