Java TimeZone String Parse guessTimeZone(String timezoneOffset)

Here you can find the source of guessTimeZone(String timezoneOffset)

Description

guess Time Zone

License

Open Source License

Declaration

public static TimeZone guessTimeZone(String timezoneOffset) 

Method Source Code

//package com.java2s;
/* // ww w.j a v a2s  .  c o m
 * =============================================================
 * Copyright (C) 2007-2011 Edgenius (http://www.edgenius.com)
 * =============================================================
 * License Information: http://www.edgenius.com/licensing/edgenius/2.0/
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2.0
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * http://www.gnu.org/licenses/gpl.txt
 *  
 * ****************************************************************
 */

import java.util.HashMap;

import java.util.Map;

import java.util.TimeZone;

public class Main {
    private static final Map<String, TimeZone> offsetMap = new HashMap<String, TimeZone>();

    public static TimeZone guessTimeZone(String timezoneOffset) {
        return offsetMap.get(timezoneOffset.trim());
    }
}

Related

  1. parseCal(long time, TimeZone to)
  2. parseDA(TimeZone tz, String s)
  3. parseTimeZoneId(String timeZoneId)
  4. parseTimeZoneString(String timeZoneString)