Cannot create TimeZone object

Help
2013-02-25
2013-06-05
  • Sandeep Gondal

    Sandeep Gondal - 2013-02-25

    Hi,
    I am unable to create net.fortuna.ical4j.model.TimeZone object. Following is my code:

    TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
    TimeZone timezone = registry.getTimeZone("GMT+5:30");

    If I use timezone ID from Olson database, then it works. But I want to create timezone object using non Olson database id like "GMT+5:30". Can this be possible?

    Amy help would be appreciated.

    Thanks

     
  • Ben Fortuna

    Ben Fortuna - 2013-02-25

    Hi Sandeep,

    Unfortunately you can only retrieve predefined timezones from the registry. If you wanted to create a custom timezone you would need to construct a VTimeZone component and define the nested Observance components manually. I would recommend just using a predefined timezone if possible though.

    regards,
    ben

     
  • Sandeep Gondal

    Sandeep Gondal - 2013-02-26

    Hi Ben,
    Thanks for your input.
    I could not find any sample to construct a VTimeZone component and define the nested Observance components. If you have any sample code, can you please share?

    Thanks
    Sandeep

     

Log in to post a comment.