summaryrefslogtreecommitdiffstats
path: root/libjava/java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-09-25 21:10:21 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-09-25 21:10:21 +0000
commitfd05f1734ce44cc6a8f4e5524eda5ac579e4378d (patch)
tree7922a2f346e1f02616c830b011180b56cb2bfc8d /libjava/java
parent733eb1b7ee82d937ec864d0efd500bb496cd7c0c (diff)
downloadppe42-gcc-fd05f1734ce44cc6a8f4e5524eda5ac579e4378d.tar.gz
ppe42-gcc-fd05f1734ce44cc6a8f4e5524eda5ac579e4378d.zip
2002-09-25 Jesse Rosenstock <jmr@ugcs.caltech.edu>
* java/util/TimeZone.java (getDSTSavings): New method. Fixes PR libgcj/7786. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57518 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/util/TimeZone.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java
index eba22363d18..6d4493001f6 100644
--- a/libjava/java/util/TimeZone.java
+++ b/libjava/java/util/TimeZone.java
@@ -961,6 +961,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.
* @return The time zone for the identifier or GMT, if no such time
OpenPOWER on IntegriCloud