1. /*
  2. * @(#)TimeZone.java 1.43 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * @(#)TimeZone.java 1.40 01/01/11
  9. *
  10. * (C) Copyright Taligent, Inc. 1996 - All Rights Reserved
  11. * (C) Copyright IBM Corp. 1996 - All Rights Reserved
  12. *
  13. * Portions copyright (c) 1996-1998 Sun Microsystems, Inc. All Rights Reserved.
  14. *
  15. * The original version of this source code and documentation is copyrighted
  16. * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These
  17. * materials are provided under terms of a License Agreement between Taligent
  18. * and Sun. This technology is protected by multiple US and International
  19. * patents. This notice and attribution to Taligent may not be removed.
  20. * Taligent is a registered trademark of Taligent, Inc.
  21. *
  22. * Permission to use, copy, modify, and distribute this software
  23. * and its documentation for NON-COMMERCIAL purposes and without
  24. * fee is hereby granted provided that this copyright notice
  25. * appears in all copies. Please refer to the file "copyright.html"
  26. * for further important copyright and licensing information.
  27. *
  28. * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  29. * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  30. * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  31. * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  32. * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  33. * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  34. *
  35. */
  36. package java.util;
  37. import java.io.Serializable;
  38. import java.lang.ref.SoftReference;
  39. import java.security.AccessController;
  40. import java.security.PrivilegedAction;
  41. import java.text.SimpleDateFormat;
  42. import java.text.NumberFormat;
  43. import java.text.ParsePosition;
  44. import sun.security.action.GetPropertyAction;
  45. /**
  46. * <code>TimeZone</code> represents a time zone offset, and also figures out daylight
  47. * savings.
  48. *
  49. * <p>
  50. * Typically, you get a <code>TimeZone</code> using <code>getDefault</code>
  51. * which creates a <code>TimeZone</code> based on the time zone where the program
  52. * is running. For example, for a program running in Japan, <code>getDefault</code>
  53. * creates a <code>TimeZone</code> object based on Japanese Standard Time.
  54. *
  55. * <p>
  56. * You can also get a <code>TimeZone</code> using <code>getTimeZone</code> along
  57. * with a time zone ID. For instance, the time zone ID for the Pacific
  58. * Standard Time zone is "PST". So, you can get a PST <code>TimeZone</code> object
  59. * with:
  60. * <blockquote>
  61. * <pre>
  62. * TimeZone tz = TimeZone.getTimeZone("PST");
  63. * </pre>
  64. * </blockquote>
  65. * You can use <code>getAvailableIDs</code> method to iterate through
  66. * all the supported time zone IDs. You can then choose a
  67. * supported ID to get a <code>TimeZone</code>.
  68. * If the time zone you want is not represented by one of the
  69. * supported IDs, then you can create a custom time zone ID with
  70. * the following syntax:
  71. *
  72. * <blockquote>
  73. * <pre>
  74. * GMT[+|-]hh[[:]mm]
  75. * </pre>
  76. * </blockquote>
  77. *
  78. * For example, you might specify GMT+14:00 as a custom
  79. * time zone ID. The <code>TimeZone</code> that is returned
  80. * when you specify a custom time zone ID does not include
  81. * daylight savings time.
  82. *
  83. *
  84. * @see Calendar
  85. * @see GregorianCalendar
  86. * @see SimpleTimeZone
  87. * @version 1.40 01/11/01
  88. * @author Mark Davis, David Goldsmith, Chen-Lieh Huang, Alan Liu
  89. */
  90. abstract public class TimeZone implements Serializable, Cloneable {
  91. /**
  92. * Sole constructor. (For invocation by subclass constructors, typically
  93. * implicit.)
  94. */
  95. public TimeZone() {
  96. }
  97. /**
  98. * A style specifier for <code>getDisplayName()</code> indicating
  99. * a short name, such as "PST."
  100. * @see #LONG
  101. */
  102. public static final int SHORT = 0;
  103. /**
  104. * A style specifier for <code>getDisplayName()</code> indicating
  105. * a long name, such as "Pacific Standard Time."
  106. * @see #SHORT
  107. */
  108. public static final int LONG = 1;
  109. // Constants used internally; unit is milliseconds
  110. private static final int ONE_MINUTE = 60*1000;
  111. private static final int ONE_HOUR = 60*ONE_MINUTE;
  112. private static final int ONE_DAY = 24*ONE_HOUR;
  113. /**
  114. * Cache to hold the SimpleDateFormat objects for a Locale.
  115. */
  116. private static Hashtable cachedLocaleData = new Hashtable(3);
  117. // Proclaim serialization compatibility with JDK 1.1
  118. static final long serialVersionUID = 3581463369166924961L;
  119. /**
  120. * Gets the time zone offset, for current date, modified in case of
  121. * daylight savings. This is the offset to add *to* UTC to get local time.
  122. * @param era the era of the given date.
  123. * @param year the year in the given date.
  124. * @param month the month in the given date.
  125. * Month is 0-based. e.g., 0 for January.
  126. * @param day the day-in-month of the given date.
  127. * @param dayOfWeek the day-of-week of the given date.
  128. * @param milliseconds the millis in day in <em>standard</em> local time.
  129. * @return the offset to add *to* GMT to get local time.
  130. */
  131. abstract public int getOffset(int era, int year, int month, int day,
  132. int dayOfWeek, int milliseconds);
  133. /**
  134. * Gets the time zone offset, for current date, modified in case of
  135. * daylight savings. This is the offset to add *to* UTC to get local time.
  136. * @param era the era of the given date.
  137. * @param year the year in the given date.
  138. * @param month the month in the given date.
  139. * Month is 0-based. e.g., 0 for January.
  140. * @param day the day-in-month of the given date.
  141. * @param dayOfWeek the day-of-week of the given date.
  142. * @param milliseconds the millis in day in <em>standard</em> local time.
  143. * @param monthLength the length of the given month in days.
  144. * @return the offset to add *to* GMT to get local time.
  145. */
  146. int getOffset(int era, int year, int month, int day,
  147. int dayOfWeek, int milliseconds, int monthLength) {
  148. // Default implementation which ignores the monthLength.
  149. // SimpleTimeZone overrides this and actually uses monthLength.
  150. return getOffset(era, year, month, day, dayOfWeek, milliseconds);
  151. }
  152. /**
  153. * Sets the base time zone offset to GMT.
  154. * This is the offset to add *to* UTC to get local time.
  155. * @param offsetMillis the given base time zone offset to GMT.
  156. */
  157. abstract public void setRawOffset(int offsetMillis);
  158. /**
  159. * Gets unmodified offset, NOT modified in case of daylight savings.
  160. * This is the offset to add *to* UTC to get local time.
  161. * @return the unmodified offset to add *to* UTC to get local time.
  162. */
  163. abstract public int getRawOffset();
  164. /**
  165. * Gets the ID of this time zone.
  166. * @return the ID of this time zone.
  167. */
  168. public String getID()
  169. {
  170. return ID;
  171. }
  172. /**
  173. * Sets the time zone ID. This does not change any other data in
  174. * the time zone object.
  175. * @param ID the new time zone ID.
  176. */
  177. public void setID(String ID)
  178. {
  179. this.ID = ID;
  180. }
  181. /**
  182. * Returns a name of this time zone suitable for presentation to the user
  183. * in the default locale.
  184. * This method returns the long name, not including daylight savings.
  185. * If the display name is not available for the locale,
  186. * then this method returns a string in the format
  187. * <code>GMT[+-]hh:mm</code>.
  188. * @return the human-readable name of this time zone in the default locale.
  189. */
  190. public final String getDisplayName() {
  191. return getDisplayName(false, LONG, Locale.getDefault());
  192. }
  193. /**
  194. * Returns a name of this time zone suitable for presentation to the user
  195. * in the specified locale.
  196. * This method returns the long name, not including daylight savings.
  197. * If the display name is not available for the locale,
  198. * then this method returns a string in the format
  199. * <code>GMT[+-]hh:mm</code>.
  200. * @param locale the locale in which to supply the display name.
  201. * @return the human-readable name of this time zone in the given locale
  202. * or in the default locale if the given locale is not recognized.
  203. */
  204. public final String getDisplayName(Locale locale) {
  205. return getDisplayName(false, LONG, locale);
  206. }
  207. /**
  208. * Returns a name of this time zone suitable for presentation to the user
  209. * in the default locale.
  210. * If the display name is not available for the locale,
  211. * then this method returns a string in the format
  212. * <code>GMT[+-]hh:mm</code>.
  213. * @param daylight if true, return the daylight savings name.
  214. * @param style either <code>LONG</code> or <code>SHORT</code>
  215. * @return the human-readable name of this time zone in the default locale.
  216. */
  217. public final String getDisplayName(boolean daylight, int style) {
  218. return getDisplayName(daylight, style, Locale.getDefault());
  219. }
  220. /**
  221. * Returns a name of this time zone suitable for presentation to the user
  222. * in the specified locale.
  223. * If the display name is not available for the locale,
  224. * then this method returns a string in the format
  225. * <code>GMT[+-]hh:mm</code>.
  226. * @param daylight if true, return the daylight savings name.
  227. * @param style either <code>LONG</code> or <code>SHORT</code>
  228. * @param locale the locale in which to supply the display name.
  229. * @return the human-readable name of this time zone in the given locale
  230. * or in the default locale if the given locale is not recognized.
  231. * @exception IllegalArgumentException style is invalid.
  232. */
  233. public String getDisplayName(boolean daylight, int style, Locale locale) {
  234. /* NOTES:
  235. * (1) We use SimpleDateFormat for simplicity; we could do this
  236. * more efficiently but it would duplicate the SimpleDateFormat code
  237. * here, which is undesirable.
  238. * (2) Attempts to move the code from SimpleDateFormat to here also run
  239. * aground because this requires SimpleDateFormat to keep a Locale
  240. * object around, which it currently doesn't; to synthesize such a
  241. * locale upon resurrection; and to somehow handle the special case of
  242. * construction from a DateFormatSymbols object.
  243. */
  244. if (style != SHORT && style != LONG) {
  245. throw new IllegalArgumentException("Illegal style: " + style);
  246. }
  247. // We keep a cache, indexed by locale. The cache contains a
  248. // SimpleDateFormat object, which we create on demand.
  249. SoftReference data = (SoftReference)cachedLocaleData.get(locale);
  250. SimpleDateFormat format;
  251. if (data == null ||
  252. (format = (SimpleDateFormat)data.get()) == null) {
  253. format = new SimpleDateFormat(null, locale);
  254. cachedLocaleData.put(locale, new SoftReference(format));
  255. }
  256. // Create a new SimpleTimeZone as a stand-in for this zone; the
  257. // stand-in will have no DST, or all DST, but the same ID and offset,
  258. // and hence the same display name.
  259. // We don't cache these because they're small and cheap to create.
  260. SimpleTimeZone tz = daylight ?
  261. new SimpleTimeZone(getRawOffset(), getID(),
  262. Calendar.JANUARY, 1, 0, 0,
  263. Calendar.DECEMBER, 31, 0, ONE_DAY) :
  264. new SimpleTimeZone(getRawOffset(), getID());
  265. format.applyPattern(style == LONG ? "zzzz" : "z");
  266. format.getCalendar().setTimeZone(tz);
  267. return format.format(new Date()); // Doesn't matter what date we use
  268. }
  269. /**
  270. * Queries if this time zone uses daylight savings time.
  271. * @return true if this time zone uses daylight savings time,
  272. * false, otherwise.
  273. */
  274. abstract public boolean useDaylightTime();
  275. /**
  276. * Queries if the given date is in daylight savings time in
  277. * this time zone.
  278. * @param date the given Date.
  279. * @return true if the given date is in daylight savings time,
  280. * false, otherwise.
  281. */
  282. abstract public boolean inDaylightTime(Date date);
  283. /**
  284. * Gets the <code>TimeZone</code> for the given ID.
  285. * @param ID the ID for a <code>TimeZone</code>, either an abbreviation such as
  286. * "PST", a full name such as "America/Los_Angeles", or a custom ID
  287. * such as "GMT-8:00".
  288. * @return the specified <code>TimeZone</code>, or the GMT zone if the given ID
  289. * cannot be understood.
  290. */
  291. public static synchronized TimeZone getTimeZone(String ID) {
  292. /* We first try to lookup the zone ID in our hashtable. If this fails,
  293. * we try to parse it as a custom string GMT[+-]hh:mm. This allows us
  294. * to recognize zones in user.timezone that otherwise cannot be
  295. * identified. We do the recognition here, rather than in getDefault(),
  296. * so that the default zone is always the result of calling
  297. * getTimeZone() with the property user.timezone.
  298. *
  299. * If all else fails, we return GMT, which is probably not what the user
  300. * wants, but at least is a functioning TimeZone object. */
  301. TimeZone zone = TimeZoneData.get(ID);
  302. if (zone == null) zone = parseCustomTimeZone(ID);
  303. if (zone == null) zone = (TimeZone)GMT.clone();
  304. return zone;
  305. }
  306. /**
  307. * Gets the available IDs according to the given time zone offset.
  308. * @param rawOffset the given time zone GMT offset.
  309. * @return an array of IDs, where the time zone for that ID has
  310. * the specified GMT offset. For example, "America/Phoenix" and "America/Denver"
  311. * both have GMT-07:00, but differ in daylight savings behavior.
  312. */
  313. // Updated to fix bug 4250355
  314. public static synchronized String[] getAvailableIDs(int rawOffset) {
  315. String[] result;
  316. Vector matched = new Vector();
  317. /* The array TimeZoneData.zones is no longer sorted by raw offset.
  318. * Now scanning through all zone data to match offset.
  319. */
  320. for (int i = 0; i < TimeZoneData.zones.length; ++i) {
  321. if (TimeZoneData.zones[i].getRawOffset() == rawOffset)
  322. matched.add(TimeZoneData.zones[i].getID());
  323. }
  324. result = new String[matched.size()];
  325. matched.toArray(result);
  326. return result;
  327. }
  328. /**
  329. * Gets all the available IDs supported.
  330. * @return an array of IDs.
  331. */
  332. public static synchronized String[] getAvailableIDs() {
  333. String[] resultArray = new String[TimeZoneData.zones.length];
  334. int count = 0;
  335. for (int i = 0; i < TimeZoneData.zones.length; ++i)
  336. resultArray[count++] = TimeZoneData.zones[i].getID();
  337. // copy into array of the right size and return
  338. String[] finalResult = new String[count];
  339. System.arraycopy(resultArray, 0, finalResult, 0, count);
  340. return finalResult;
  341. }
  342. /**
  343. * Gets the platform defined TimeZone ID.
  344. **/
  345. private static native String getSystemTimeZoneID(String javaHome,
  346. String region);
  347. /**
  348. * Gets the default <code>TimeZone</code> for this host.
  349. * The source of the default <code>TimeZone</code>
  350. * may vary with implementation.
  351. * @return a default <code>TimeZone</code>.
  352. */
  353. public static synchronized TimeZone getDefault() {
  354. if (defaultZone == null) {
  355. // get the time zone ID from the system properties
  356. String zoneID = (String) AccessController.doPrivileged(
  357. new GetPropertyAction("user.timezone"));
  358. // if the time zone ID is not set (yet), perform the
  359. // platform to Java time zone ID mapping.
  360. if (zoneID == null || zoneID.equals("")) {
  361. String region = (String) AccessController.doPrivileged(
  362. new GetPropertyAction("user.region"));
  363. String javaHome = (String) AccessController.doPrivileged(
  364. new GetPropertyAction("java.home"));
  365. zoneID = getSystemTimeZoneID(javaHome, region);
  366. if (zoneID == null) {
  367. zoneID = GMT_ID;
  368. }
  369. final String id = zoneID;
  370. AccessController.doPrivileged(new PrivilegedAction() {
  371. public Object run() {
  372. System.setProperty("user.timezone", id);
  373. return null;
  374. }
  375. });
  376. }
  377. defaultZone = getTimeZone(zoneID);
  378. }
  379. return (TimeZone)defaultZone.clone();
  380. }
  381. /**
  382. * Sets the <code>TimeZone</code> that is
  383. * returned by the <code>getDefault</code> method.
  384. * @param zone the new default time zone
  385. */
  386. public static synchronized void setDefault(TimeZone zone)
  387. {
  388. defaultZone = zone;
  389. }
  390. /**
  391. * Returns true if this zone has the same rule and offset as another zone.
  392. * That is, if this zone differs only in ID, if at all.
  393. * @param other the <code>TimeZone</code> object to be compared with
  394. * @return true if the given zone is the same as this one,
  395. * with the possible exception of the ID
  396. */
  397. public boolean hasSameRules(TimeZone other) {
  398. return getRawOffset() == other.getRawOffset() &&
  399. useDaylightTime() == other.useDaylightTime();
  400. }
  401. /**
  402. * Overrides Cloneable
  403. */
  404. public Object clone()
  405. {
  406. try {
  407. TimeZone other = (TimeZone) super.clone();
  408. other.ID = ID;
  409. return other;
  410. } catch (CloneNotSupportedException e) {
  411. throw new InternalError();
  412. }
  413. }
  414. // =======================privates===============================
  415. /**
  416. * The string identifier of this <code>TimeZone</code>. This is a
  417. * programmatic identifier used internally to look up <code>TimeZone</code>
  418. * objects from the system table and also to map them to their localized
  419. * display names. <code>ID</code> values are unique in the system
  420. * table but may not be for dynamically created zones.
  421. * @serial
  422. */
  423. private String ID;
  424. private static TimeZone defaultZone = null;
  425. static final String GMT_ID = "GMT";
  426. private static final int GMT_ID_LENGTH = 3;
  427. private static final String CUSTOM_ID = "Custom";
  428. private static NumberFormat numberFormat = null;
  429. private static final TimeZone GMT = new SimpleTimeZone(0, GMT_ID);
  430. /**
  431. * Parse a custom time zone identifier and return a corresponding zone.
  432. * @param id a string of the form GMT[+-]hh:mm, GMT[+-]hhmm, or
  433. * GMT[+-]hh.
  434. * @return a newly created SimpleTimeZone with the given offset and
  435. * no daylight savings time, or null if the id cannot be parsed.
  436. */
  437. private static final SimpleTimeZone parseCustomTimeZone(String id) {
  438. if (id.length() > GMT_ID_LENGTH &&
  439. id.regionMatches(true, 0, GMT_ID, 0, GMT_ID_LENGTH)) {
  440. ParsePosition pos = new ParsePosition(GMT_ID_LENGTH);
  441. boolean negative = false;
  442. int offset;
  443. if (id.charAt(pos.getIndex()) == '-')
  444. negative = true;
  445. else if (id.charAt(pos.getIndex()) != '+')
  446. return null;
  447. pos.setIndex(pos.getIndex() + 1);
  448. // Create NumberFormat if necessary
  449. synchronized (TimeZoneData.class) {
  450. if (numberFormat == null) {
  451. numberFormat = NumberFormat.getInstance();
  452. numberFormat.setParseIntegerOnly(true);
  453. }
  454. }
  455. synchronized (numberFormat) {
  456. // Look for either hh:mm, hhmm, or hh
  457. int start = pos.getIndex();
  458. Number n = numberFormat.parse(id, pos);
  459. if (n == null) return null;
  460. offset = n.intValue();
  461. if (pos.getIndex() < id.length() &&
  462. id.charAt(pos.getIndex()) == ':') {
  463. // hh:mm
  464. offset *= 60;
  465. pos.setIndex(pos.getIndex() + 1);
  466. n = numberFormat.parse(id, pos);
  467. if (n == null) return null;
  468. offset += n.intValue();
  469. }
  470. else {
  471. // hhmm or hh
  472. // Be strict about interpreting something as hh; it must be
  473. // an offset < 30, and it must be one or two digits. Thus
  474. // 0010 is interpreted as 00:10, but 10 is interpreted as
  475. // 10:00.
  476. if (offset < 30 && (pos.getIndex() - start) <= 2)
  477. offset *= 60; // hh, from 00 to 29; 30 is 00:30
  478. else
  479. offset = offset % 100 + offset / 100 * 60; // hhmm
  480. }
  481. if (negative) offset = -offset;
  482. return new SimpleTimeZone(offset * 60000, CUSTOM_ID);
  483. }
  484. }
  485. return null;
  486. }
  487. // Internal Implementation Notes [LIU]
  488. //
  489. // TimeZone data is stored in two parts. The first is an encoding of the
  490. // rules for each TimeZone. A TimeZone rule includes the offset of a zone
  491. // in milliseconds from GMT, the starting month and day for daylight savings
  492. // time, if there is any, and the ending month and day for daylight savings
  493. // time. The starting and ending days are specified in terms of the n-th
  494. // day of the week, for instance, the first Sunday or the last ("-1"-th)
  495. // Sunday of the month. The rules are stored as statically-constructed
  496. // SimpleTimeZone objects in the TimeZone class.
  497. //
  498. // Each rule has a unique internal identifier string which is used to
  499. // specify it. This identifier string is arbitrary, and is not to be shown
  500. // to the user -- it is for programmatic use only. In order to instantiate
  501. // a TimeZone object, you pass its identifier string to
  502. // TimeZone.getTimeZone(). (This identifier is also used to index the
  503. // localized string data.)
  504. //
  505. // The second part of the data consists of localized string names used by
  506. // DateFormat to describe various TimeZones. A TimeZone may have up to four
  507. // names: The abbreviated and long name for standard time in that zone, and
  508. // the abbreviated and long name for daylight savings time in that zone.
  509. // The data also includes a representative city. For example, [ "PST",
  510. // "Pacific Standard Time", "PDT", "Pacific Daylight Time", "Los Angeles" ]
  511. // might be one such set of string names in the en_US locale. These strings
  512. // are intended to be shown to the user. The string data is indexed in the
  513. // system by a pair (String id, Locale locale). The id is the unique string
  514. // identifier for the rule for the given TimeZone (as passed to
  515. // TimeZone.getTimeZone()). String names are stored as localized resource
  516. // data of the class java.text.resources.DateFormatZoneData??? where ??? is
  517. // the Locale specifier (e.g., DateFormatZoneData_en_US). This data is a
  518. // two-dimensional array of strings with N rows and 6 columns. The columns
  519. // are id, short standard name, long standard name, short daylight name,
  520. // long daylight name, representative city name.
  521. //
  522. // The mapping between rules (SimpleTimeZone objects) and localized string
  523. // names (DateFormatZoneData objects) is one-to-many. That is, there will
  524. // sometimes be more than one localized string name sets associated with
  525. // each rule.
  526. //
  527. // Each locale can potentially have localized name data for all time zones.
  528. // Since we support approximately 90 time zones and approximately 50
  529. // locales, there can be over 4500 sets of localized names. In practice,
  530. // only a fraction of these names are provided. If a time zone needs to be
  531. // displayed to the user in a given locale, and there is no string data in
  532. // that locale for that time zone, then the default representation will be
  533. // shown. This is a string of the form GMT+HHMM or GMT-HHMM, where HHMM
  534. // represents the offset in hours and minutes with respect to GMT. This
  535. // format is used because it is recognized in all locales. In order to make
  536. // this mechanism to work, the root resource data (in the class
  537. // DateFormatZoneData) is left empty.
  538. //
  539. // The current default TimeZone is determined via the system property
  540. // user.timezone. This is set by the platform-dependent native code to
  541. // a three-letter abbreviation. We interpret these into our own internal
  542. // IDs using a lookup table.
  543. }
  544. /**
  545. * Encapsulates data for international timezones. This package-private class is for
  546. * internal use only by TimeZone. It encapsulates the list of recognized international
  547. * timezones. By implementing this as a separate class, the loading and initialization
  548. * cost for this array is delayed until a TimeZone object is actually created from its ID.
  549. * This class contains only static variables and static methods; it cannot be instantiated.
  550. */
  551. class TimeZoneData
  552. {
  553. static final TimeZone get(String ID) {
  554. Object o = lookup.get(ID);
  555. return o == null ? null : (TimeZone)((TimeZone)o).clone(); // [sic]
  556. }
  557. // ---------------- BEGIN GENERATED DATA ----------------
  558. private static final int ONE_HOUR = 60*60*1000;
  559. static SimpleTimeZone zones[] = {
  560. // The following data is current as of 1998.
  561. // Total Unix zones: 343
  562. // Total Java zones: 289
  563. // Not all Unix zones become Java zones due to duplication and overlap.
  564. //----------------------------------------------------------
  565. new SimpleTimeZone(-11*ONE_HOUR, "Pacific/Niue" /*NUT*/),
  566. // Pacific/Niue Niue(NU) -11:00 - NUT
  567. //----------------------------------------------------------
  568. new SimpleTimeZone(-11*ONE_HOUR, "Pacific/Apia" /*WST*/),
  569. // Pacific/Apia W Samoa(WS) -11:00 - WST # W Samoa Time
  570. new SimpleTimeZone(-11*ONE_HOUR, "MIT" /*alias for Pacific/Apia*/),
  571. //----------------------------------------------------------
  572. new SimpleTimeZone(-11*ONE_HOUR, "Pacific/Pago_Pago" /*SST*/),
  573. // Pacific/Pago_Pago American Samoa(US) -11:00 - SST # S=Samoa
  574. //----------------------------------------------------------
  575. new SimpleTimeZone(-10*ONE_HOUR, "Pacific/Tahiti" /*TAHT*/),
  576. // Pacific/Tahiti French Polynesia(PF) -10:00 - TAHT # Tahiti Time
  577. //----------------------------------------------------------
  578. new SimpleTimeZone(-10*ONE_HOUR, "Pacific/Fakaofo" /*TKT*/),
  579. // Pacific/Fakaofo Tokelau Is(TK) -10:00 - TKT # Tokelau Time
  580. //----------------------------------------------------------
  581. new SimpleTimeZone(-10*ONE_HOUR, "Pacific/Honolulu" /*HST*/),
  582. // Pacific/Honolulu Hawaii(US) -10:00 - HST
  583. new SimpleTimeZone(-10*ONE_HOUR, "HST" /*alias for Pacific/Honolulu*/),
  584. //----------------------------------------------------------
  585. new SimpleTimeZone(-10*ONE_HOUR, "America/Adak" /*HA%sT*/,
  586. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  587. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  588. // Rule US 1967 max - Oct lastSun 2:00 0 S
  589. // Rule US 1987 max - Apr Sun>=1 2:00 1:00 D
  590. // America/Adak Alaska(US) -10:00 US HA%sT
  591. //----------------------------------------------------------
  592. new SimpleTimeZone(-10*ONE_HOUR, "Pacific/Rarotonga") /*CK%sT*/,
  593. // Zone Pacific/Rarotonga Cook Is(CK) -10:00 Cook CK%sT
  594. //----------------------------------------------------------
  595. new SimpleTimeZone((int)(-9.5*ONE_HOUR), "Pacific/Marquesas" /*MART*/),
  596. // Pacific/Marquesas French Polynesia(PF) -9:30 - MART # Marquesas Time
  597. //----------------------------------------------------------
  598. new SimpleTimeZone(-9*ONE_HOUR, "Pacific/Gambier" /*GAMT*/),
  599. // Pacific/Gambier French Polynesia(PF) -9:00 - GAMT # Gambier Time
  600. //----------------------------------------------------------
  601. new SimpleTimeZone(-9*ONE_HOUR, "America/Anchorage" /*AK%sT*/,
  602. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  603. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  604. // Rule US 1967 max - Oct lastSun 2:00 0 S
  605. // Rule US 1987 max - Apr Sun>=1 2:00 1:00 D
  606. // America/Anchorage Alaska(US) -9:00 US AK%sT
  607. new SimpleTimeZone(-9*ONE_HOUR, "AST" /*alias for America/Anchorage*/,
  608. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  609. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  610. //----------------------------------------------------------
  611. new SimpleTimeZone((int)(-8.5*ONE_HOUR), "Pacific/Pitcairn" /*PNT*/),
  612. // Pacific/Pitcairn Pitcairn(PN) -8:30 - PNT # Pitcairn Time
  613. //----------------------------------------------------------
  614. new SimpleTimeZone(-8*ONE_HOUR, "America/Vancouver" /*P%sT*/,
  615. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  616. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  617. // Rule Vanc 1962 max - Oct lastSun 2:00 0 S
  618. // Rule Vanc 1987 max - Apr Sun>=1 2:00 1:00 D
  619. // America/Vancouver British Columbia(CA) -8:00 Vanc P%sT
  620. //----------------------------------------------------------
  621. new SimpleTimeZone(-8*ONE_HOUR, "America/Tijuana" /*P%sT*/,
  622. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  623. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  624. // Rule Mexico 1996 max - Apr Sun>=1 2:00 1:00 D
  625. // Rule Mexico 1996 max - Oct lastSun 2:00 0 S
  626. // America/Tijuana Mexico(MX) -8:00 Mexico P%sT
  627. //----------------------------------------------------------
  628. new SimpleTimeZone(-8*ONE_HOUR, "America/Los_Angeles" /*P%sT*/,
  629. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  630. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  631. // Rule US 1967 max - Oct lastSun 2:00 0 S
  632. // Rule US 1987 max - Apr Sun>=1 2:00 1:00 D
  633. // America/Los_Angeles US Pacific time, represented by Los Angeles(US) -8:00 US P%sT
  634. new SimpleTimeZone(-8*ONE_HOUR, "PST" /*alias for America/Los_Angeles*/,
  635. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  636. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  637. //----------------------------------------------------------
  638. new SimpleTimeZone(-7*ONE_HOUR, "America/Dawson_Creek" /*MST*/),
  639. // America/Dawson_Creek British Columbia(CA) -7:00 - MST
  640. //----------------------------------------------------------
  641. new SimpleTimeZone(-7*ONE_HOUR, "America/Phoenix" /*MST*/),
  642. // America/Phoenix ?(US) -7:00 - MST
  643. new SimpleTimeZone(-7*ONE_HOUR, "PNT" /*alias for America/Phoenix*/),
  644. //----------------------------------------------------------
  645. new SimpleTimeZone(-7*ONE_HOUR, "America/Edmonton" /*M%sT*/,
  646. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  647. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  648. // Rule Edm 1972 max - Oct lastSun 2:00 0 S
  649. // Rule Edm 1987 max - Apr Sun>=1 2:00 1:00 D
  650. // America/Edmonton Alberta(CA) -7:00 Edm M%sT
  651. //----------------------------------------------------------
  652. new SimpleTimeZone(-7*ONE_HOUR, "America/Mazatlan" /*M%sT*/,
  653. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  654. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  655. // Rule Mexico 1996 max - Apr Sun>=1 2:00 1:00 D
  656. // Rule Mexico 1996 max - Oct lastSun 2:00 0 S
  657. // America/Mazatlan Mexico(MX) -7:00 Mexico M%sT
  658. //----------------------------------------------------------
  659. new SimpleTimeZone(-7*ONE_HOUR, "America/Denver" /*M%sT*/,
  660. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  661. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  662. // Rule US 1967 max - Oct lastSun 2:00 0 S
  663. // Rule US 1987 max - Apr Sun>=1 2:00 1:00 D
  664. // America/Denver US Mountain time, represented by Denver(US) -7:00 US M%sT
  665. new SimpleTimeZone(-7*ONE_HOUR, "MST" /*alias for America/Denver*/,
  666. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  667. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  668. //----------------------------------------------------------
  669. new SimpleTimeZone(-6*ONE_HOUR, "America/Belize" /*C%sT*/),
  670. // America/Belize Belize(BZ) -6:00 - C%sT
  671. //----------------------------------------------------------
  672. new SimpleTimeZone(-6*ONE_HOUR, "America/Regina" /*CST*/),
  673. // America/Regina Saskatchewan(CA) -6:00 - CST
  674. //----------------------------------------------------------
  675. new SimpleTimeZone(-6*ONE_HOUR, "Pacific/Galapagos" /*GALT*/),
  676. // Pacific/Galapagos Ecuador(EC) -6:00 - GALT # Galapagos Time
  677. //----------------------------------------------------------
  678. new SimpleTimeZone(-6*ONE_HOUR, "America/Guatemala" /*C%sT*/),
  679. // America/Guatemala Guatemala(GT) -6:00 - C%sT
  680. //----------------------------------------------------------
  681. new SimpleTimeZone(-6*ONE_HOUR, "America/Tegucigalpa" /*C%sT*/),
  682. // America/Tegucigalpa Honduras(HN) -6:00 - C%sT
  683. //----------------------------------------------------------
  684. new SimpleTimeZone(-6*ONE_HOUR, "America/El_Salvador" /*C%sT*/),
  685. // America/El_Salvador El Salvador(SV) -6:00 - C%sT
  686. //----------------------------------------------------------
  687. new SimpleTimeZone(-6*ONE_HOUR, "America/Costa_Rica" /*C%sT*/),
  688. // America/Costa_Rica Costa Rica(CR) -6:00 - C%sT
  689. //----------------------------------------------------------
  690. new SimpleTimeZone(-6*ONE_HOUR, "America/Winnipeg" /*C%sT*/,
  691. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  692. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  693. // Rule Winn 1966 max - Oct lastSun 2:00 0 S
  694. // Rule Winn 1987 max - Apr Sun>=1 2:00 1:00 D
  695. // America/Winnipeg Manitoba(CA) -6:00 Winn C%sT
  696. //----------------------------------------------------------
  697. new SimpleTimeZone(-6*ONE_HOUR, "Pacific/Easter" /*EAS%sT*/,
  698. Calendar.OCTOBER, 9, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR,
  699. Calendar.MARCH, 9, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR, 1*ONE_HOUR),
  700. // Rule Chile 1969 max - Oct Sun>=9 0:00 1:00 S
  701. // Rule Chile 1970 max - Mar Sun>=9 0:00 0 -
  702. // Pacific/Easter Chile(CL) -6:00 Chile EAS%sT
  703. //----------------------------------------------------------
  704. new SimpleTimeZone(-6*ONE_HOUR, "America/Mexico_City" /*C%sT*/,
  705. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  706. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  707. // Rule Mexico 1996 max - Apr Sun>=1 2:00 1:00 D
  708. // Rule Mexico 1996 max - Oct lastSun 2:00 0 S
  709. // America/Mexico_City Mexico(MX) -6:00 Mexico C%sT
  710. //----------------------------------------------------------
  711. new SimpleTimeZone(-6*ONE_HOUR, "America/Chicago" /*C%sT*/,
  712. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  713. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  714. // Rule US 1967 max - Oct lastSun 2:00 0 S
  715. // Rule US 1987 max - Apr Sun>=1 2:00 1:00 D
  716. // America/Chicago US Central time, represented by Chicago(US) -6:00 US C%sT
  717. new SimpleTimeZone(-6*ONE_HOUR, "CST" /*alias for America/Chicago*/,
  718. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  719. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  720. //----------------------------------------------------------
  721. new SimpleTimeZone(-5*ONE_HOUR, "America/Porto_Acre" /*AST*/),
  722. // America/Porto_Acre Brazil(BR) -5:00 - AST
  723. //----------------------------------------------------------
  724. new SimpleTimeZone(-5*ONE_HOUR, "America/Bogota" /*CO%sT*/),
  725. // America/Bogota Colombia(CO) -5:00 - CO%sT # Colombia Time
  726. //----------------------------------------------------------
  727. new SimpleTimeZone(-5*ONE_HOUR, "America/Guayaquil" /*ECT*/),
  728. // America/Guayaquil Ecuador(EC) -5:00 - ECT # Ecuador Time
  729. //----------------------------------------------------------
  730. new SimpleTimeZone(-5*ONE_HOUR, "America/Jamaica" /*EST*/),
  731. // America/Jamaica Jamaica(JM) -5:00 - EST
  732. //----------------------------------------------------------
  733. new SimpleTimeZone(-5*ONE_HOUR, "America/Cayman" /*EST*/),
  734. // America/Cayman Cayman Is(KY) -5:00 - EST
  735. //----------------------------------------------------------
  736. new SimpleTimeZone(-5*ONE_HOUR, "America/Managua" /*EST*/),
  737. // America/Managua Nicaragua(NI) -5:00 - EST
  738. //----------------------------------------------------------
  739. new SimpleTimeZone(-5*ONE_HOUR, "America/Panama" /*EST*/),
  740. // America/Panama Panama(PA) -5:00 - EST
  741. //----------------------------------------------------------
  742. new SimpleTimeZone(-5*ONE_HOUR, "America/Lima" /*PE%sT*/),
  743. // America/Lima Peru(PE) -5:00 - PE%sT # Peru Time
  744. //----------------------------------------------------------
  745. new SimpleTimeZone(-5*ONE_HOUR, "America/Indianapolis" /*EST*/),
  746. // America/Indianapolis Indiana(US) -5:00 - EST
  747. new SimpleTimeZone(-5*ONE_HOUR, "IET" /*alias for America/Indianapolis*/),
  748. //----------------------------------------------------------
  749. new SimpleTimeZone(-5*ONE_HOUR, "America/Nassau" /*E%sT*/,
  750. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  751. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  752. // Rule Bahamas 1964 max - Oct lastSun 2:00 0 S
  753. // Rule Bahamas 1987 max - Apr Sun>=1 2:00 1:00 D
  754. // America/Nassau Bahamas(BS) -5:00 Bahamas E%sT
  755. //----------------------------------------------------------
  756. new SimpleTimeZone(-5*ONE_HOUR, "America/Montreal" /*E%sT*/,
  757. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  758. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  759. // Rule Mont 1957 max - Oct lastSun 2:00 0 S
  760. // Rule Mont 1987 max - Apr Sun>=1 2:00 1:00 D
  761. // America/Montreal Ontario, Quebec(CA) -5:00 Mont E%sT
  762. //----------------------------------------------------------
  763. new SimpleTimeZone(-5*ONE_HOUR, "America/Havana" /*C%sT*/,
  764. Calendar.MARCH, -1, Calendar.SUNDAY /*DOW_GE_DOM*/, 0,
  765. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_GE_DOM*/, 1*ONE_HOUR, 1*ONE_HOUR),
  766. // Rule Cuba 1998 max - Mar lastSun 0:00s 1:00 D
  767. // Rule Cuba 1998 max - Oct lastSun 0:00s 0 S
  768. // Zone America/Havana Cuba(CU) -5:00 Cuba C%sT
  769. //----------------------------------------------------------
  770. new SimpleTimeZone(-5*ONE_HOUR, "America/Port-au-Prince"),
  771. // Zone America/Port-au-Prince Haiti(HT) -5:00 Haiti E%sT
  772. //----------------------------------------------------------
  773. new SimpleTimeZone(-5*ONE_HOUR, "America/Grand_Turk" /*E%sT*/,
  774. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR,
  775. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 0*ONE_HOUR, 1*ONE_HOUR),
  776. // Rule TC 1979 max - Oct lastSun 0:00 0 S
  777. // Rule TC 1987 max - Apr Sun>=1 0:00 1:00 D
  778. // America/Grand_Turk Turks and Caicos(TC) -5:00 TC E%sT
  779. //----------------------------------------------------------
  780. new SimpleTimeZone(-5*ONE_HOUR, "America/New_York" /*E%sT*/,
  781. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  782. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  783. // Rule US 1967 max - Oct lastSun 2:00 0 S
  784. // Rule US 1987 max - Apr Sun>=1 2:00 1:00 D
  785. // America/New_York US Eastern time, represented by New York(US) -5:00 US E%sT
  786. new SimpleTimeZone(-5*ONE_HOUR, "EST" /*alias for America/New_York*/,
  787. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  788. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  789. //----------------------------------------------------------
  790. new SimpleTimeZone(-4*ONE_HOUR, "America/Antigua" /*AST*/),
  791. // America/Antigua Antigua and Barbuda(AG) -4:00 - AST
  792. //----------------------------------------------------------
  793. new SimpleTimeZone(-4*ONE_HOUR, "America/Anguilla" /*AST*/),
  794. // America/Anguilla Anguilla(AI) -4:00 - AST
  795. //----------------------------------------------------------
  796. new SimpleTimeZone(-4*ONE_HOUR, "America/Curacao" /*AST*/),
  797. // America/Curacao Curacao(AN) -4:00 - AST
  798. //----------------------------------------------------------
  799. new SimpleTimeZone(-4*ONE_HOUR, "America/Aruba" /*AST*/),
  800. // America/Aruba Aruba(AW) -4:00 - AST
  801. //----------------------------------------------------------
  802. new SimpleTimeZone(-4*ONE_HOUR, "America/Barbados" /*A%sT*/),
  803. // America/Barbados Barbados(BB) -4:00 - A%sT
  804. //----------------------------------------------------------
  805. new SimpleTimeZone(-4*ONE_HOUR, "America/La_Paz" /*BOT*/),
  806. // America/La_Paz Bolivia(BO) -4:00 - BOT # Bolivia Time
  807. //----------------------------------------------------------
  808. new SimpleTimeZone(-4*ONE_HOUR, "America/Manaus" /*WST*/),
  809. // America/Manaus Brazil(BR) -4:00 - WST
  810. //----------------------------------------------------------
  811. new SimpleTimeZone(-4*ONE_HOUR, "America/Dominica" /*AST*/),
  812. // America/Dominica Dominica(DM) -4:00 - AST
  813. //----------------------------------------------------------
  814. new SimpleTimeZone(-4*ONE_HOUR, "America/Santo_Domingo" /*AST*/),
  815. // America/Santo_Domingo Dominican Republic(DO) -4:00 - AST
  816. //----------------------------------------------------------
  817. new SimpleTimeZone(-4*ONE_HOUR, "America/Grenada" /*AST*/),
  818. // America/Grenada Grenada(GD) -4:00 - AST
  819. //----------------------------------------------------------
  820. new SimpleTimeZone(-4*ONE_HOUR, "America/Guadeloupe" /*AST*/),
  821. // America/Guadeloupe Guadeloupe(GP) -4:00 - AST
  822. //----------------------------------------------------------
  823. new SimpleTimeZone(-4*ONE_HOUR, "America/Guyana" /*GYT*/),
  824. // America/Guyana Guyana(GY) -4:00 - GYT
  825. //----------------------------------------------------------
  826. new SimpleTimeZone(-4*ONE_HOUR, "America/St_Kitts" /*AST*/),
  827. // America/St_Kitts St Kitts-Nevis(KN) -4:00 - AST
  828. //----------------------------------------------------------
  829. new SimpleTimeZone(-4*ONE_HOUR, "America/St_Lucia" /*AST*/),
  830. // America/St_Lucia St Lucia(LC) -4:00 - AST
  831. //----------------------------------------------------------
  832. new SimpleTimeZone(-4*ONE_HOUR, "America/Martinique" /*AST*/),
  833. // America/Martinique Martinique(MQ) -4:00 - AST
  834. //----------------------------------------------------------
  835. new SimpleTimeZone(-4*ONE_HOUR, "America/Montserrat" /*AST*/),
  836. // America/Montserrat Montserrat(MS) -4:00 - AST
  837. //----------------------------------------------------------
  838. new SimpleTimeZone(-4*ONE_HOUR, "America/Puerto_Rico" /*AST*/),
  839. // America/Puerto_Rico Puerto Rico(PR) -4:00 - AST
  840. new SimpleTimeZone(-4*ONE_HOUR, "PRT" /*alias for America/Puerto_Rico*/),
  841. //----------------------------------------------------------
  842. new SimpleTimeZone(-4*ONE_HOUR, "America/Port_of_Spain" /*AST*/),
  843. // America/Port_of_Spain Trinidad and Tobago(TT) -4:00 - AST
  844. //----------------------------------------------------------
  845. new SimpleTimeZone(-4*ONE_HOUR, "America/St_Vincent" /*AST*/),
  846. // America/St_Vincent St Vincent and the Grenadines(VC) -4:00 - AST
  847. //----------------------------------------------------------
  848. new SimpleTimeZone(-4*ONE_HOUR, "America/Tortola" /*AST*/),
  849. // America/Tortola British Virgin Is(VG) -4:00 - AST
  850. //----------------------------------------------------------
  851. new SimpleTimeZone(-4*ONE_HOUR, "America/St_Thomas" /*AST*/),
  852. // America/St_Thomas Virgin Is(VI) -4:00 - AST
  853. //----------------------------------------------------------
  854. new SimpleTimeZone(-4*ONE_HOUR, "America/Caracas" /*VET*/),
  855. // America/Caracas Venezuela(VE) -4:00 - VET
  856. //----------------------------------------------------------
  857. new SimpleTimeZone(-4*ONE_HOUR, "Antarctica/Palmer" /*CL%sT*/,
  858. Calendar.OCTOBER, 9, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR,
  859. Calendar.MARCH, 9, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR, 1*ONE_HOUR),
  860. // Rule ChileAQ 1969 max - Oct Sun>=9 0:00 1:00 S
  861. // Rule ChileAQ 1970 max - Mar Sun>=9 0:00 0 -
  862. // Antarctica/Palmer USA - year-round bases(AQ) -4:00 ChileAQ CL%sT
  863. //----------------------------------------------------------
  864. new SimpleTimeZone(-4*ONE_HOUR, "Atlantic/Bermuda" /*A%sT*/,
  865. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  866. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  867. // Rule Bahamas 1964 max - Oct lastSun 2:00 0 S
  868. // Rule Bahamas 1987 max - Apr Sun>=1 2:00 1:00 D
  869. // Atlantic/Bermuda Bermuda(BM) -4:00 Bahamas A%sT
  870. //----------------------------------------------------------
  871. new SimpleTimeZone(-4*ONE_HOUR, "America/Cuiaba"),
  872. // Zone America/Cuiaba Brazil(BR) -4:00 - WST
  873. //----------------------------------------------------------
  874. new SimpleTimeZone(-4*ONE_HOUR, "America/Halifax" /*A%sT*/,
  875. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  876. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  877. // Rule Halifax 1962 max - Oct lastSun 2:00 0 S
  878. // Rule Halifax 1987 max - Apr Sun>=1 2:00 1:00 D
  879. // America/Halifax ?(CA) -4:00 Halifax A%sT
  880. //----------------------------------------------------------
  881. new SimpleTimeZone(-4*ONE_HOUR, "Atlantic/Stanley" /*FK%sT*/,
  882. Calendar.SEPTEMBER, 8, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR,
  883. Calendar.APRIL, 16, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR, 1*ONE_HOUR),
  884. // Rule Falk 1986 max - Apr Sun>=16 0:00 0 -
  885. // Rule Falk 1996 max - Sep Sun>=8 0:00 1:00 S
  886. // Atlantic/Stanley Falklands(FK) -4:00 Falk FK%sT
  887. //----------------------------------------------------------
  888. new SimpleTimeZone(-4*ONE_HOUR, "America/Thule" /*A%sT*/,
  889. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  890. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  891. // Rule Thule 1993 max - Apr Sun>=1 2:00 1:00 D
  892. // Rule Thule 1993 max - Oct lastSun 2:00 0 S
  893. // America/Thule ?(GL) -4:00 Thule A%sT
  894. //----------------------------------------------------------
  895. new SimpleTimeZone(-4*ONE_HOUR, "America/Asuncion" /*PY%sT*/,
  896. Calendar.OCTOBER, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR,
  897. Calendar.FEBRUARY, -1, Calendar.SUNDAY /*DOW_IN_MON*/, 0*ONE_HOUR, 1*ONE_HOUR),
  898. // Rule Para 1996 max - Oct Sun>=1 0:00 1:00 S
  899. // Rule Para 1999 max - Feb lastSun 0:00 0 -
  900. // Zone America/Asuncion Paraguay(PY) -4:00 Para PY%sT
  901. //----------------------------------------------------------
  902. new SimpleTimeZone(-4*ONE_HOUR, "America/Santiago" /*CL%sT*/,
  903. Calendar.OCTOBER, 9, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR,
  904. Calendar.MARCH, 9, -Calendar.SUNDAY /*DOW>=DOM*/, 0*ONE_HOUR, 1*ONE_HOUR),
  905. // Rule Chile 1969 max - Oct Sun>=9 0:00 1:00 S
  906. // Rule Chile 1970 max - Mar Sun>=9 0:00 0 -
  907. // America/Santiago Chile(CL) -4:00 Chile CL%sT
  908. //----------------------------------------------------------
  909. new SimpleTimeZone((int)(-3.5*ONE_HOUR), "America/St_Johns" /*N%sT*/,
  910. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  911. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  912. // Rule StJohns 1960 max - Oct lastSun 2:00 0 S
  913. // Rule StJohns 1989 max - Apr Sun>=1 2:00 1:00 D
  914. // America/St_Johns Canada(CA) -3:30 StJohns N%sT
  915. new SimpleTimeZone((int)(-3.5*ONE_HOUR), "CNT" /*alias for America/St_Johns*/,
  916. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_HOUR,
  917. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_DOM*/, 2*ONE_HOUR, 1*ONE_HOUR),
  918. //----------------------------------------------------------
  919. new SimpleTimeZone(-3*ONE_HOUR, "America/Fortaleza" /*EST*/),
  920. // America/Fortaleza Brazil(BR) -3:00 - EST
  921. //----------------------------------------------------------
  922. new SimpleTimeZone(-3*ONE_HOUR, "America/Cayenne" /*GFT*/),
  923. // America/Cayenne French Guiana(GF) -3:00 - GFT
  924. //----------------------------------------------------------
  925. new SimpleTimeZone(-3*ONE_HOUR, "America/Paramaribo" /*SRT*/),
  926. // America/Paramaribo Suriname(SR) -3:00 - SRT
  927. //----------------------------------------------------------
  928. new SimpleTimeZone(-3*ONE_HOUR, "America/Montevideo" /*UY%sT*/),
  929. // America/Montevideo Uruguay(UY) -3:00 - UY%sT
  930. //----------------------------------------------------------
  931. new SimpleTimeZone(-3*ONE_HOUR, "America/Buenos_Aires" /*AR%sT*/),
  932. // America/Buenos_Aires Argentina(AR) -3:00 - AR%sT
  933. new SimpleTimeZone(-3*ONE_HOUR, "AGT" /*alias for America/Buenos_Aires*/),
  934. //----------------------------------------------------------
  935. new SimpleTimeZone(-3*ONE_HOUR, "America/Godthab" /*WG%sT*/,
  936. Calendar.MARCH, -1, Calendar.SUNDAY /*DOW_IN_MON*/, 0*ONE_HOUR,
  937. Calendar.OCTOBER, -1, Calendar.SUNDAY /*DOW_IN_MON*/, 0*ONE_HOUR, 1*ONE_HOUR),
  938. // Rule EU 1981 max - Mar lastSun 1:00u 1:00 S
  939. // Rule EU 1996 max - Oct lastSun 1:00u 0 -
  940. // Zone America/Godthab ?(GL) -3:00 EU WG%sT
  941. //----------------------------------------------------------
  942. new SimpleTimeZone(-3*ONE_HOUR, "America/Miquelon" /*PM%sT*/,
  943. Calendar.APRIL, 1, -Calendar.SUNDAY /*DOW>=DOM*/, 2*ONE_H