[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] FYI: Small TimeZone fix
From: |
Sven de Marothy |
Subject: |
Re: [cp-patches] FYI: Small TimeZone fix |
Date: |
Fri, 18 Feb 2005 17:44:53 +0100 |
Argh, you're right. I'll fix it.
Stupid eastern hemisphere.
/Sven
On Fri, 2005-02-18 at 16:28 +0100, Mark Wielaard wrote:
> 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