mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-26 12:23:59 +08:00
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:
parent
a8efb5bb1e
commit
465ee71e97
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user