Class GMTZone

java.lang.Object
   |
   +----java.util.TimeZone
           |
           +----java.util.SimpleTimeZone
                   |
                   +----GMTZone

public class GMTZone
extends SimpleTimeZone
This fix makes available the "Europe/London" and other time zones corresponding to the GMT meridian. More than three-letter time zones aren't working in releases 1.1.6 and 1.1.7, even though the data for several hundred time zones seems to be there.
This class just overrides the three static methods in the java.util.TimeZone class. To implement the fix, make this class available and replace calls to TimeZone.getTimeZone() with GMTZone.getTimeZone() . That is, change "TimeZone" to "GMTZone". You can simply replace all references to java.util.TimeZone with references to GMTZone for all locales. This update of GMTZone also overrides the two getAvailableIDs() methods so your added zone ID's can be "user-selectable" at runtime.
This class just adds "Europe/London" (and BST or IST) time zones (and others) if requested in the appropriate locales, for example, "en_GB" for "BST", and "en_IE" for "IST." Of course, if you use this fix in your code, be prepared to "unfix" it in 3 or 4 years when nobody needs this anymore. Compiles to 1456 bytes without the test code in main().

Version:
1.03 - May 1999
Author:
Tony Dahlman

Constructor Index

 o GMTZone()

Method Index

 o getAvailableIDs()
Adds the additional supported time zone ID's to the list of all available ID's.
Overrides - getAvailableIDs() in java.util.TimeZone
 o getAvailableIDs(int)
Replaces the list of supported time zone ID's at zero offset from GMT.
Overrides - getAvailableIDs( rawOffset ) in java.util.TimeZone
 o getTimeZone(String)
You can add other "more than 3-letter zone ID's" if you wish by just adding additional "else if" code to this method, and maybe renaming the class.
 o main(String[])
Illustrative test code

Constructors

 o GMTZone
 private GMTZone()

Methods

 o getTimeZone
 public static synchronized TimeZone getTimeZone(String ID)
You can add other "more than 3-letter zone ID's" if you wish by just adding additional "else if" code to this method, and maybe renaming the class. This code is "forwards compatible" with Java 2 so the long time zone IDs supported in JDK 1.2 will be honored when users upgrade.
Overrides - getTimeZone() in class java.util.TimeZone

 o getAvailableIDs
 public static synchronized String[] getAvailableIDs()
Adds the additional supported time zone ID's to the list of all available ID's.
Overrides - getAvailableIDs() in java.util.TimeZone

 o getAvailableIDs
 public static synchronized String[] getAvailableIDs(int rawOffset)
Replaces the list of supported time zone ID's at zero offset from GMT.
Overrides - getAvailableIDs( rawOffset ) in java.util.TimeZone

 o main
 public static void main(String args[])
Illustrative test code