Menu

Generating VTIMEZONE

Anonymous
2014-01-10
2014-02-03
  • Anonymous

    Anonymous - 2014-01-10

    Hi,

    It looks like the Outlook does not accept VEvents with TZID set, even
    though its a standard ID.
    TimezoneId must be always referencing VTIMEZONE object defined on Calendar
    level.
    (Google and Apple accept it, without any problems).

    Now the question is: "Is there a way how to generate simply full-fledged
    VTimezone object"
    from TimeZoneId. Some factory method which would return a value from set
    of
    standard VTimezone objects would be the best.
    Something like: VTimezone.getInstance("timeZoneId");

    There must be only a limited number of standard TimeZones defined after
    all.

    PS: Its clear how to create VTimezone, it's just not so clear, where to get
    the standard/daylight dates, offsets (ideally without touching database).

    Thanks for suggestions,

    Vlada.

     
  • Michael Angstadt

    Vlada,

    Good question. I have looked into this, but was not able to find a simple solution. :( Maybe you will be more successful. ;)

    The problem is that the Java TimeZone object doesn't have a method that lets you retrieve the start/end times of daylight savings or standard time. Joda might be able to help, but I'd rather not add another dependency to biweekly if I don't have to. But you might want to look into Joda yourself for this purpose.

    Another solution (for biweekly at least) would be to hard-code VTIMEZONE components for a small number of the "most-used" timezones, instead of generating them dynamically.

    Ugh, VTIMEZONE is the bane of my existence. xD

     
  • Anonymous

    Anonymous - 2014-01-21

    Joda can help you get the standard offset and daylight offset too. (Even though daylight offset can be dependent on time instant). You can also get previous and next daylight/standard switch dates. But the problem is there is no easy way to derive RRULE for daylight/standard switching.

    So In the end we downloaded the timezone definitions from http://tzurl.org/
    and stored into DB (with occasional updates). Looks like Google is using outlook format.. so do we.

    ICal4J has the timezone definitions stored as resources, right in the jar file. So to update the definitions you probably have to upgrade lib. version.

     

Anonymous
Anonymous

Add attachments
Cancel