You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Catherine Hope (JIRA)" <ji...@apache.org> on 2009/07/11 21:17:14 UTC

[jira] Created: (HARMONY-6269) [classlib][luni] Default GMT TimeZone has no display name defined

[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.


Re: [jira] Created: (HARMONY-6269) [classlib][luni] Default GMT TimeZone has no display name defined

Posted by Catherine Hope <ca...@googlemail.com>.
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 <zh...@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 <li...@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

Re: [jira] Created: (HARMONY-6269) [classlib][luni] Default GMT TimeZone has no display name defined

Posted by Kevin Zhou <zh...@gmail.com>.
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 <li...@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

Re: [jira] Created: (HARMONY-6269) [classlib][luni] Default GMT TimeZone has no display name defined

Posted by Charles Lee <li...@gmail.com>.
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) <ji...@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

[jira] Commented: (HARMONY-6269) [classlib][luni] Default GMT TimeZone has no display name defined

Posted by "Kevin Zhou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731245#action_12731245 ] 

Kevin Zhou commented on HARMONY-6269:
-------------------------------------

Hi Cath,
I suggest that you refer to SPEC of ICU to confirm whether it provides such a functionality. Or is the pattern "z" incorrect? If not, I think you can add a private method inside TimeZone of Harmony to extract and return the abbreviation of names instead. 

> [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.


[jira] Commented: (HARMONY-6269) [classlib][luni] Default GMT TimeZone has no display name defined

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-6269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12788173#action_12788173 ] 

Sebb commented on HARMONY-6269:
-------------------------------

The string "GMT+00:00" is also returned for "zzz" and "zzzz", whereas the RI returns "GMT" and "Greenwich Mean Time" respectively when using Locale.US.

This has implications for Cookie generation (and causes a test failure in HttpComponents HttpClient).

> [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.