diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-18 16:43:02 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-18 16:43:02 +0000 |
commit | 2cda82a002af22e1f2461435b1c8079a0dbff7c8 (patch) | |
tree | cb2e22f6dd5cf497057e4366b83afd45d2d0f1bd /libjava | |
parent | 281c29c27190a881d471629e5bb3590d7f1b3ca1 (diff) | |
download | gcc-2cda82a002af22e1f2461435b1c8079a0dbff7c8.tar.gz |
2003-12-18 Michael Koch <konqueror@gmx.de>
* java/util/TimeZone.java (getOffset): New method.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74784 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 4 | ||||
-rw-r--r-- | libjava/java/util/TimeZone.java | 18 |
2 files changed, 21 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index b384a293998..36048e4bf2a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2003-12-18 Michael Koch <konqueror@gmx.de> + + * java/util/TimeZone.java (getOffset): New method. + 2003-12-17 Fernando Nasser <fnasser@redhat.com> * gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): Fix generation diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java index db9ff6b1051..2636956527d 100644 --- a/libjava/java/util/TimeZone.java +++ b/libjava/java/util/TimeZone.java @@ -1,5 +1,6 @@ /* java.util.TimeZone - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -810,6 +811,21 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable int day, int dayOfWeek, int milliseconds); /** + * Get the time zone offset for the specified date, modified in case of + * daylight savings. This is the offset to add to UTC to get the local + * time. + * @param date the date represented in millisecends + * since January 1, 1970 00:00:00 GMT. + * @since 1.4 + */ + public int getOffset(long date) + { + return (inDaylightTime(new Date(date)) + ? getRawOffset() + getDSTSavings() + : getRawOffset()); + } + + /** * Gets the time zone offset, ignoring daylight savings. This is * the offset to add to UTC to get the local time. * @return the time zone offset in milliseconds. |