[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] FYI: Small TimeZone fix
From: |
Mark Wielaard |
Subject: |
Re: [cp-patches] FYI: Small TimeZone fix |
Date: |
Fri, 18 Feb 2005 16:28:39 +0100 |
Hi Sven,
On Fri, 2005-02-18 at 15:50 +0100, Sven de Marothy wrote:
> 2005-02-18 Sven de Marothy <address@hidden>
>
> * java/util/TimeZone.java,
> (getDefaultDisplayName): Don't print zero offsets.
Urgh. Probably my fault but I believe it will always append + now
because we moved it just after the statement to make offset absolute.
- sb.append(offset >= 0 ? '+' : '-');
offset = Math.abs(offset) / (1000 * 60);
int hours = offset / 60;
int minutes = offset % 60;
- sb.append((char) ('0' + hours / 10)).append((char) ('0' + hours % 10));
- sb.append(':');
- sb.append((char) ('0' + minutes / 10)).append((char) ('0' + minutes % 10));
+ if (minutes != 0 || hours != 0)
+ {
+ sb.append(offset >= 0 ? '+' : '-');
Cheers,
Mark
signature.asc
Description: This is a digitally signed message part