summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-03-12 10:44:54 +0000
committerNeil Fuller <nfuller@google.com>2014-03-12 10:44:54 +0000
commit15737123c4b241c331e0090d311afb9631c3cf1b (patch)
treef3f5a5068928d37c44c180118dc35f51b5b38388 /luni
parent4189a6e183e8c38992df6de29321733fad06e50a (diff)
downloadlibcore-15737123c4b241c331e0090d311afb9631c3cf1b.zip
libcore-15737123c4b241c331e0090d311afb9631c3cf1b.tar.gz
libcore-15737123c4b241c331e0090d311afb9631c3cf1b.tar.bz2
Add 1.7 methods to TimeZone / SimpleTimeZone
The RI documents the required implementation. Unlike the RI, SimpleTimeZone in Android does not override the TimeZone implementation: it seems pointless to do so given it appears to rely on the implementation details of another method (inDaylightTime()) which can, itself, be overridden. Change-Id: I45d89cf0f30b49bb77c6dcfdae1a81edea40a2d4
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/java/util/TimeZone.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/luni/src/main/java/java/util/TimeZone.java b/luni/src/main/java/java/util/TimeZone.java
index c024e8d..48f11f9 100644
--- a/luni/src/main/java/java/util/TimeZone.java
+++ b/luni/src/main/java/java/util/TimeZone.java
@@ -403,6 +403,22 @@ public abstract class TimeZone implements Serializable, Cloneable {
}
/**
+ * Returns true if this timezone is in a daylight savings time period for or if it will be in at
+ * any time in the future.
+ *
+ * <p>The default implementation is equivalent to:
+ * <br />{@code return useDaylightTime() || inDaylightTime(new Date());}
+ *
+ * <p>See {@link #useDaylightTime()} and {@link #inDaylightTime(Date)} for more information.
+ *
+ * @since 1.7
+ * @hide Until ready for an API update
+ */
+ public boolean observesDaylightTime() {
+ return useDaylightTime() || inDaylightTime(new Date());
+ }
+
+ /**
* Returns true if {@code time} is in a daylight savings time period for
* this time zone.
*/