abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James M Snell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (ABDERA-44) Date with TimeZone doesn't work (ex: 2005-12-11T10:10:10+01:00)
Date Fri, 13 Jul 2007 06:27:04 GMT

    [ https://issues.apache.org/jira/browse/ABDERA-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512374
] 

James M Snell commented on ABDERA-44:
-------------------------------------

In my testing...

    Date date=AtomDate.parse("2005-12-12T12:12:12+04:00");
    System.out.println(date);
    date=  AtomDate.parse("2005-12-12T12:12:12GMT+04:00");
    System.out.println(date); 

Results in...

    Mon Dec 12 00:12:12 PST 2005
    Mon Dec 12 00:12:12 PST 2005

If I explicitly set the timezone to CET..

    TimeZone tz = TimeZone.getTimeZone("CET");
    TimeZone.setDefault(tz);
    
    Date date=AtomDate.parse("2005-12-12T12:12:12+04:00");
    System.out.println(date);
    date=     AtomDate.parse("2005-12-12T12:12:12GMT+04:00");
    System.out.println(date); 

It comes out as

    Mon Dec 12 09:12:12 CET 2005
    Mon Dec 12 09:12:12 CET 2005

I've tried this on four different machines, with the IBM and Sun 1.4.2 and 1.5 JDKs and received
the same result on each.

> Date with TimeZone doesn't work (ex: 2005-12-11T10:10:10+01:00)
> ---------------------------------------------------------------
>
>                 Key: ABDERA-44
>                 URL: https://issues.apache.org/jira/browse/ABDERA-44
>             Project: Abdera
>          Issue Type: Bug
>         Environment: JDK 6, windows XP
>            Reporter: NIcolas Maisonneuve
>
> AtomDate.java handles only this pattern
> 2005-12-11T10:10:10Z
> but not this kind of pattern
> 2005-12-11T10:10:10+01:00 
> (wrong date generated)
> 	date=AtomDate.parse("2005-12-12T12:12:12+01:00");
> 	System.out.println(date);
> --> 
> Mon Dec 12 01:00:00 CET 2005

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message