Menu

#38 Addis Ababa Timezone is broken

Pre-release (0.9)
open
Output (11)
9
2006-10-14
2006-10-14
No

There seems to be a problem with the Addis Ababa
timezone. This isn't a problem with any of the other
timezones I've tried, including LA, London and
Brisbane, Australia. However, it may be a general
problem for TZs similar to Addis'.

Looking at the timezone definition in the jar, I'm not
exactly sure what the problem is, although the first
STANDARD section in the Addis timezone looks odd to me.
That said, all the timezones have an extremely large
number for the TZOFFSETFROM value, and they seem to
work fine.

Anyway, the problem is that for whatever reason, the
Addis timezone is converting the time very badly. I
didn't notice at first because if you both save and
read the calendar using iCal4j it seems fine. But if
you try opening the generated file with another program
(eg iCal), the Addis times are way off. This is what
gets generated for midnight Addis time, October 14, 2006:

BEGIN:VEVENT
DTSTAMP:20061014T023501Z
UID:15MKHP0PWFUNULB35R1PCBU89GLX4IJH
SEQUENCE:4
ORGANIZER;CN=admin:mailto:admin@randombits.org
SUMMARY:Midnight in Addis Ababa
LOCATION:Addis Ababa
DTSTART;TZID=Africa/Addis_Ababa:20061013T233520
DTEND;TZID=Africa/Addis_Ababa:20061014T003520
END:VEVENT

The times should be 'T000000' and 'T010000', but are
being converted very oddly.

The weirdness is happening in the
DateTime.setTimeZone() method. Below is a code sample
which reproduces the above:

TimeZoneRegistry reg =
TimeZoneRegistryFactory.getInstance().createRegistry();
TimeZone timeZone = reg.getTimeZone("Africa/Addis_Ababa");

long millis = 1160773200000; // This is 21:00 Oct 13,
2006 UTC, aka 00:00 Oct 14, Addis time
DateTime icalDateTime = new DateTime(millis);
// At this point, a 'toString()' call lists the time
// correctly in the local computer's default timezone
// in my case, 07:00 Oct 14, 2006, Australia/Brisbane
icalDateTime.setTimeZone(timeZone);
// Now, a 'toString() call lists the time to be
23:35:30, Oct 13, 2006 Addis Time

Hope this helps. Any assistance would be greatly
appreciated. Attached is a calendar with four events,
each set to start at midnight Oct 14, 2006 in their
specific timezone. Only Addis is wrong...

Discussion

  • David Peterson

    David Peterson - 2006-10-14

    Test calendar containing broken converted time.

     
  • David Peterson

    David Peterson - 2006-10-14
    • priority: 5 --> 9
     

Log in to post a comment.