Java TimeZone Create getTimeZone(String timeZone)

Here you can find the source of getTimeZone(String timeZone)

Description

This gets the TimeZone object for the given string.

License

Open Source License

Declaration

public static TimeZone getTimeZone(String timeZone) 

Method Source Code

//package com.java2s;

import java.util.TimeZone;

public class Main {
    /**//from   w ww .  j a v a2s  .c  o m
    * This is used to indicate the default local time zone. 
    */
    public static final String LOCAL_TIME = "LOCAL";

    /**
    * This gets the TimeZone object for the given string. "LOCAL" results
    * in the default time zone getting returned.
    */
    public static TimeZone getTimeZone(String timeZone) {

        if (timeZone.equalsIgnoreCase(LOCAL_TIME)) {

            return TimeZone.getDefault();

        }

        return TimeZone.getTimeZone(timeZone);

    }
}

Related

  1. getTimeZone(final String id)
  2. getTimeZone(final String tzId)
  3. getTimeZone(int rawoffset)
  4. getTimeZone(String id)
  5. getTimeZone(String idParam)
  6. getTimeZone(String timeZone)
  7. getTimeZone(String timeZoneId)
  8. getTimezoneAbbreviation(String tzid, boolean dst)
  9. getTimeZoneChecked(String id)