Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.1709 diff -u -b -B -r1.1709 ChangeLog --- ChangeLog 26 Dec 2003 20:27:04 -0000 1.1709 +++ ChangeLog 26 Dec 2003 20:35:47 -0000 @@ -1,5 +1,9 @@ 2003-12-26 Michael Koch + * java/util/TimeZone.java (getOffset): New method. + +2003-12-26 Michael Koch + * javax/naming/event/EventDirContext.java: Jalopied. (addNamingListener): Fixed typo in method name. Index: java/util/TimeZone.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/TimeZone.java,v retrieving revision 1.21 diff -u -b -B -r1.21 TimeZone.java --- java/util/TimeZone.java 12 Aug 2003 13:41:26 -0000 1.21 +++ java/util/TimeZone.java 26 Dec 2003 20:35:47 -0000 @@ -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. @@ -809,6 +810,21 @@ public abstract int getOffset(int era, int year, int month, 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.