diff --git a/projects/Time/8/org/joda/time/DateTimeZone.java b/projects/Time/8/org/joda/time/DateTimeZone.java index 7d1719b..a127604 100644 --- a/projects/Time/8/org/joda/time/DateTimeZone.java +++ b/projects/Time/8/org/joda/time/DateTimeZone.java @@ -276,14 +276,17 @@ public static DateTimeZone forOffsetHoursMinutes(int hoursOffset, int minutesOff if (hoursOffset < -23 || hoursOffset > 23) { throw new IllegalArgumentException("Hours out of range: " + hoursOffset); } - if (minutesOffset < 0 || minutesOffset > 59) { + if (minutesOffset < -59 || minutesOffset > 59) { throw new IllegalArgumentException("Minutes out of range: " + minutesOffset); } + if (hoursOffset > 0 && minutesOffset < 0) { + throw new IllegalArgumentException("Positive hours must not have negative minutes: " + minutesOffset); + } int offset = 0; try { int hoursInMinutes = hoursOffset * 60; if (hoursInMinutes < 0) { - minutesOffset = hoursInMinutes - minutesOffset; + minutesOffset = hoursInMinutes - Math.abs(minutesOffset); } else { minutesOffset = hoursInMinutes + minutesOffset; }