harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Catherine Hope <catherine.v.h...@googlemail.com>
Subject Re: [jira] Created: (HARMONY-6269) [classlib][luni] Default GMT TimeZone has no display name defined
Date Wed, 15 Jul 2009 09:36:15 GMT
I agree it's working to the specification, but it seems an oversight that
there isn't a display name defined for the default time zone "GMT".
Compared to both IBM and Sun Java, which will provide the full display name,
and consequently you can format the time zone in dates properly on these
versions.

Also, the ICU list of time zones maps several other ones to the string
"Greenwich Mean Time" (such as "Iceland"), but not "GMT", which suggests
it's an oversight.

On Wed, Jul 15, 2009 at 7:31 AM, Kevin Zhou <zhoukevin83@gmail.com> wrote:

> Hi Cath,
> In fact, ICU does provide such a method for getting abbreviation of display
> name of timezones. But ICU also deprecates the usage of abbreviations since
> some time zone IDs can be used for multiple time zones. For instance, "CST"
> may stand for U.S. "Central Standard Time" and "Chinese China Standard
> Time". Java platform can only identify one of them.
>
> Sometimes, Harmony implementation may not use the time zone data of ICU.
> When invoking java.util.TimeZone.getDefault(), it calls a native method
> "getCustomTimeZone" to get the time zone ID from system. For example, on my
> PC, this native method returns "GMT+0800". Then, it formats this string to
> "GMT+08:00" and uses it as an ID to defer to com.ibm.icu.util.TimeZone for
> the value. But ICU fails to find the correct time zone, creates and returns
> a new time zone with an display name of "GMT+08:00".
>
> On Wed, Jul 15, 2009 at 11:15 AM, Charles Lee <littlee1032@gmail.com>
> wrote:
>
> > Hi Cath,
> >
> > In the ICU api doc, SimpleDateFormat, it says "For time zones that have
> no
> > names, use strings GMT+hours:minutes or GMT-hours:minutes. ". You can
> find
> > details here <http://icu-project.org/apiref/icu4j/>.
> >
> > On Sun, Jul 12, 2009 at 3:17 AM, Catherine Hope (JIRA) <jira@apache.org
> > >wrote:
> >
> > > [classlib][luni] Default GMT TimeZone has no display name defined
> > > -----------------------------------------------------------------
> > >
> > >                 Key: HARMONY-6269
> > >                 URL:
> https://issues.apache.org/jira/browse/HARMONY-6269
> > >             Project: Harmony
> > >          Issue Type: Bug
> > >         Environment: all
> > >            Reporter: Catherine Hope
> > >            Priority: Minor
> > >
> > >
> > > The default TimeZone, GMT, has no display names defined - calling
> > > getDisplayName() always returns "GMT+00:00" instead of "Greenwich Mean
> > Time"
> > > or the short form "GMT".  This also has implications for date
> formatting
> > -
> > > creating a SimpleDateFormat with pattern "z", will display the time
> zone
> > as
> > > "GMT+00:00" instead of "GMT".  The harmony implementation of
> > > TimeZone.getDisplayName() is deferring to com.ibm.icu.util.TimeZone for
> > the
> > > value, which has some long display names set , but not GMT, so I'm
> unsure
> > > where to fix this.
> > >
> > > --
> > > This message is automatically generated by JIRA.
> > > -
> > > You can reply to this email to add a comment to the issue online.
> > >
> > >
> >
> >
> > --
> > Yours sincerely,
> > Charles Lee
> >
>
>
>
> --
> Best regards,
> Yours, Kevin Zhou
>



-- 
Catherine Hope
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message