re PR libgcj/7786 (TimeZone.getDSTSavings() from JDK1.4 not implemented)
authorJesse Rosenstock <jmr@ugcs.caltech.edu>
Wed, 25 Sep 2002 21:10:21 +0000 (21:10 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 25 Sep 2002 21:10:21 +0000 (21:10 +0000)
2002-09-25  Jesse Rosenstock  <jmr@ugcs.caltech.edu>

* java/util/TimeZone.java (getDSTSavings): New method.
Fixes PR libgcj/7786.

From-SVN: r57518

libjava/ChangeLog
libjava/java/util/TimeZone.java

index dc94efbc3a03c6b97f28c16a0cbc889e270a4ee3..242b2b11534f19d0d18d701bab52f479b03a51de 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-25  Jesse Rosenstock  <jmr@ugcs.caltech.edu>
+
+       * java/util/TimeZone.java (getDSTSavings): New method.
+       Fixes PR libgcj/7786.
+
 2002-09-25  Jesse Rosenstock  <jmr@ugcs.caltech.edu>
 
        * resolve.cc (_Jv_ResolvePoolEntry) [end_of_method_search]: Check
index eba22363d185da8ee83f6282f56621bba503d563..6d4493001f6634ee3efcb73e4a959af359812ce8 100644 (file)
@@ -960,6 +960,22 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
    */
   public abstract boolean inDaylightTime(Date date);
 
+  /**
+   * Gets the daylight savings offset.  This is a positive offset in
+   * milliseconds with respect to standard time.  Typically this
+   * is one hour, but for some time zones this may be half an our.
+   * <p>The default implementation returns 3600000 milliseconds
+   * (one hour) if the time zone uses daylight savings time
+   * (as specified by {@link #useDaylightTime()}), otherwise
+   * it returns 0.
+   * @return the daylight savings offset in milliseconds.
+   * @since 1.4
+   */
+  public int getDSTSavings ()
+  {
+    return useDaylightTime () ? 3600000 : 0;
+  }
+
   /**
    * Gets the TimeZone for the given ID.
    * @param ID the time zone identifier.