/** * Builds a Java TimeZone from the VTIMEZONE info in an * iCal file. * @return a Java TimeZone that matches the iCal one, or NULL if no TZ info present */ public static SimpleTimeZone buildTimeZone(String ical) { return buildTimeZone( getICalParams(ical) ); }
/** * Builds a Java TimeZone from the VTIMEZONE info in an * iCal file. * @return a Java TimeZone that matches the iCal one, or NULL if no TZ info present */ public static SimpleTimeZone buildTimeZone(String ical) { return buildTimeZone( getICalParams(ical) ); }
/** * Checks we correctly build the Timezone for somewhere * that doesn't have DST (eg Brisbane) */ @Test public void simpleTimeZoneNoDST() { SimpleTimeZone tz = CalendarTimezoneHelper.buildTimeZone(ICAL_TZ_BRISBANE); assertNotNull(tz); assertEquals("Brisbane", tz.getID()); // Doesn't do DST assertEquals(false, tz.useDaylightTime()); // Always 10 hours ahead assertEquals(10*60*60*1000, tz.getOffset(date(2011,3,1).getTime())); assertEquals(10*60*60*1000, tz.getOffset(date(2011,9,1).getTime())); assertEquals(10*60*60*1000, tz.getOffset(date(2011,11,1).getTime())); }
SimpleTimeZone tz = CalendarTimezoneHelper.buildTimeZone(ICAL_TZ_LONDON);
SimpleTimeZone tz = CalendarTimezoneHelper.buildTimeZone(ICAL_TZ_SYDNEY);