summaryrefslogtreecommitdiff
path: root/java/text/SimpleDateFormat.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2006-04-19 17:49:42 +0000
committerTom Tromey <tromey@redhat.com>2006-04-19 17:49:42 +0000
commitb43abec5bebe748417b85fc7f111fd64f82e15b1 (patch)
treed9deb284fe0b35fd8d0b3a4778e642020fc76c8f /java/text/SimpleDateFormat.java
parent76f52c446b3cf94eb8e8572f9fdf507e159b8d6e (diff)
downloadclasspath-b43abec5bebe748417b85fc7f111fd64f82e15b1.tar.gz
* java/text/SimpleDateFormat.java (formatWithAttribute): Take absolute
value of 'pureMinutes'. PR classpath/27189.
Diffstat (limited to 'java/text/SimpleDateFormat.java')
-rw-r--r--java/text/SimpleDateFormat.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/java/text/SimpleDateFormat.java b/java/text/SimpleDateFormat.java
index c0c4cf68c..00c08507e 100644
--- a/java/text/SimpleDateFormat.java
+++ b/java/text/SimpleDateFormat.java
@@ -805,7 +805,8 @@ public class SimpleDateFormat extends DateFormat
buffer.setDefaultAttribute(DateFormat.Field.RFC822_TIME_ZONE);
int pureMinutes = (calendar.get(Calendar.ZONE_OFFSET) +
calendar.get(Calendar.DST_OFFSET)) / (1000 * 60);
- String sign = (pureMinutes < 0) ? "-" : "+";
+ String sign = (pureMinutes < 0) ? "-" : "+";
+ pureMinutes = Math.abs(pureMinutes);
int hours = pureMinutes / 60;
int minutes = pureMinutes % 60;
buffer.append(sign);