diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 5840e54ec13..d90f01f0d97 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,13 @@ +2004-01-28 Jeroen Frijters + + PR libgcj/19649 + * java/util/Date.java + (Date(int,int,int), Date(int,int,int,int,int)): Delegate to other + constructor. + (Date(int,int,int,int,int,int)): Fixed to handle out-of-range + arguments. + (getTimezoneOffset): Inverted sign. + 2005-01-26 Ranjit Mathew * testsuite/libjava.jacks/jacks.xfail: Update for PR java/19070, diff --git a/libjava/java/util/Date.java b/libjava/java/util/Date.java index f2700e48873..4a96ff03d5a 100644 --- a/libjava/java/util/Date.java +++ b/libjava/java/util/Date.java @@ -159,7 +159,7 @@ public class Date */ public Date(int year, int month, int day) { - time = new GregorianCalendar(year + 1900, month, day).getTimeInMillis(); + this(year, month, day, 0, 0, 0); } /** @@ -176,9 +176,7 @@ public class Date */ public Date(int year, int month, int day, int hour, int min) { - time = - new GregorianCalendar(year + 1900, month, day, hour, - min).getTimeInMillis(); + this(year, month, day, hour, min, 0); } /** @@ -197,9 +195,9 @@ public class Date */ public Date(int year, int month, int day, int hour, int min, int sec) { - time = - new GregorianCalendar(year + 1900, month, day, hour, min, - sec).getTimeInMillis(); + GregorianCalendar cal = + new GregorianCalendar(year + 1900, month, day, hour, min, sec); + time = cal.getTimeInMillis(); } /** @@ -288,7 +286,7 @@ public class Date { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(time); - return (cal.get(Calendar.ZONE_OFFSET) + return - (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000); }