Here you can find the source of parseBackendTimeZone(String timeZone)
Parameter | Description |
---|---|
timeZone | time zone to use |
public static TimeZone parseBackendTimeZone(String timeZone)
//package com.java2s; /*//from ww w . j a v a 2 s . c o m * Copyright (c) 2003, PostgreSQL Global Development Group * See the LICENSE file in the project root for more information. */ import java.util.HashMap; import java.util.TimeZone; public class Main { private static final HashMap<String, TimeZone> GMT_ZONES = new HashMap<String, TimeZone>(); /** * Converts backend's TimeZone parameter to java format. * Notable difference: backend's gmt-3 is GMT+03 in Java. * * @param timeZone time zone to use * @return java TimeZone */ public static TimeZone parseBackendTimeZone(String timeZone) { if (timeZone.startsWith("GMT")) { TimeZone tz = GMT_ZONES.get(timeZone); if (tz != null) { return tz; } } return TimeZone.getTimeZone(timeZone); } }