re PR libgcj/19649 (java.util.Date.getTimezoneOffset returns negated output)

2004-01-28  Jeroen Frijters  <jeroen@frijters.net>

	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.

From-SVN: r94401
This commit is contained in:
Jeroen Frijters 2005-01-29 00:43:50 +00:00 committed by Bryce McKinlay
parent 73095ebc07
commit 8f43f502de
2 changed files with 16 additions and 8 deletions

View File

@ -1,3 +1,13 @@
2004-01-28 Jeroen Frijters <jeroen@frijters.net>
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 <rmathew@hotmail.com>
* testsuite/libjava.jacks/jacks.xfail: Update for PR java/19070,

View File

@ -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);
}