Commit 465ee71e by Sven de Marothy Committed by Michael Koch

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
parent a8efb5bb
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> 2005-04-27 Roman Kennke <roman@kennke.org>
* javax/swing/plaf/basic/BasicScrollBarUI * javax/swing/plaf/basic/BasicScrollBarUI
......
...@@ -1107,15 +1107,21 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable ...@@ -1107,15 +1107,21 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
StringBuffer sb = new StringBuffer(9); StringBuffer sb = new StringBuffer(9);
sb.append("GMT"); sb.append("GMT");
sb.append(offset >= 0 ? '+' : '-');
offset = Math.abs(offset) / (1000 * 60); offset = offset / (1000 * 60);
int hours = offset / 60; int hours = Math.abs(offset) / 60;
int minutes = offset % 60; int minutes = Math.abs(offset) % 60;
sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10)); 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(':');
sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10)); sb.append((char) ('0' + minutes / 10));
sb.append((char) ('0' + minutes % 10));
}
return sb.toString(); return sb.toString();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment