You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Kyle Cho (JIRA)" <ji...@apache.org> on 2009/10/28 01:47:59 UTC

[jira] Created: (HARMONY-6363) [classlib][icu4j] simple date format in UTC seems to work differently than IBM and Sun JDK

[classlib][icu4j] simple date format in UTC seems to work differently than IBM and Sun JDK
------------------------------------------------------------------------------------------

                 Key: HARMONY-6363
                 URL: https://issues.apache.org/jira/browse/HARMONY-6363
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M11
         Environment: X86/Redhat EL 5
            Reporter: Kyle Cho
            Priority: Minor


class dateformat2 {
        public static void main(String args[]) throws Exception
        {
                java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
                java.util.TimeZone tz = java.util.TimeZone.getTimeZone("UTC");
                sdf.setTimeZone(tz);
                java.util.Date d = sdf.parse("Wed Oct 28 03:45:42 UTC 2009");
                String s = sdf.format(d);
                System.out.println(s);
        }
}

With above test case,
Harmony DRL prints:
Wed Oct 28 03:45:42 GMT+00:00 2009

IBM and Sun JDK print:
Wed Oct 28 03:45:42 UTC 2009


I understand that UTC and GMT+00:00 are equivalent.
However when app sets timezone id to "UTC" and wants to display time format with "UTC", why does Harmony display in "GMT+00:00" format? It seems icu4j(one of dependencies) does not properly handle this case.

-- 
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-6363) [classlib][icu4j] simple date format in UTC seems to work differently than IBM and Sun JDK

Posted by Charles Lee <li...@gmail.com>.
Is this similiar to HARMONY-6269 ?

On Wed, Oct 28, 2009 at 8:47 AM, Kyle Cho (JIRA) <ji...@apache.org> wrote:

> [classlib][icu4j] simple date format in UTC seems to work differently than
> IBM and Sun JDK
>
> ------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6363
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6363
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M11
>         Environment: X86/Redhat EL 5
>            Reporter: Kyle Cho
>            Priority: Minor
>
>
> class dateformat2 {
>        public static void main(String args[]) throws Exception
>        {
>                java.text.SimpleDateFormat sdf = new
> java.text.SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
>                java.util.TimeZone tz =
> java.util.TimeZone.getTimeZone("UTC");
>                sdf.setTimeZone(tz);
>                java.util.Date d = sdf.parse("Wed Oct 28 03:45:42 UTC
> 2009");
>                String s = sdf.format(d);
>                System.out.println(s);
>        }
> }
>
> With above test case,
> Harmony DRL prints:
> Wed Oct 28 03:45:42 GMT+00:00 2009
>
> IBM and Sun JDK print:
> Wed Oct 28 03:45:42 UTC 2009
>
>
> I understand that UTC and GMT+00:00 are equivalent.
> However when app sets timezone id to "UTC" and wants to display time format
> with "UTC", why does Harmony display in "GMT+00:00" format? It seems
> icu4j(one of dependencies) does not properly handle this case.
>
> --
> 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