2005-04-27 Sven de Marothy <sven@physto.se>

* java/util/TimeZone.java,
	(getDefaultDisplayName): Fix previous fix.

2005-04-27  Sven de Marothy <sven@physto.se>

	* java/util/TimeZone.java,
	(getDefaultDisplayName): Don't print zero offsets.

From-SVN: r98874
This commit is contained in:
Sven de Marothy 2005-04-27 20:47:40 +02:00 committed by Michael Koch
parent a8efb5bb1e
commit 465ee71e97
2 changed files with 23 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2005-04-27 Sven de Marothy <sven@physto.se>
* java/util/TimeZone.java,
(getDefaultDisplayName): Fix previous fix.
2005-04-27 Sven de Marothy <sven@physto.se>
* java/util/TimeZone.java,
(getDefaultDisplayName): Don't print zero offsets.
2005-04-27 Roman Kennke <roman@kennke.org>
* javax/swing/plaf/basic/BasicScrollBarUI

View File

@ -1107,15 +1107,21 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
StringBuffer sb = new StringBuffer(9);
sb.append("GMT");
sb.append(offset >= 0 ? '+' : '-');
offset = Math.abs(offset) / (1000 * 60);
int hours = offset / 60;
int minutes = offset % 60;
offset = offset / (1000 * 60);
int hours = Math.abs(offset) / 60;
int minutes = Math.abs(offset) % 60;
if (minutes != 0 || hours != 0)
{
sb.append(offset >= 0 ? '+' : '-');
sb.append((char) ('0' + hours / 10));
sb.append((char) ('0' + hours % 10));
sb.append(':');
sb.append((char) ('0' + minutes / 10));
sb.append((char) ('0' + minutes % 10));
}
sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10));
sb.append(':');
sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10));
return sb.toString();
}