Stephen Colebourne wrote:
> The DateTimeZoneBuilder class is what you need for this task. The
> builder is focussed around being easy to use from the tz database
> format, but the iCal data is similar.
> 
> Here is the example:
> 
>  * DateTimeZone America_Los_Angeles = new DateTimeZoneBuilder()
> Initial setup
> 
>  *     .addCutover(-2147483648, 'w', 1, 1, 0, false, 0)
>  *     .setStandardOffset(-28378000)
>  *     .setFixedSavings("LMT", 0)
> These three lines are a one-time cutover
> 
>  *     .addCutover(1883, 'w', 11, 18, 0, false, 43200000)
>  *     .setStandardOffset(-28800000)
> These two lines are also a one time cutover
> 
>  *     .addRecurringSavings("PDT", 3600000, 1918, 1919, 'w',  3, -1,
> 7, false, 7200000)
>  *     .addRecurringSavings("PST",       0, 1918, 1919, 'w', 10, -1,
> 7, false, 7200000)
> These two lines are the transition into and out of DST.
> 
>  *     .toDateTimeZone("America/Los_Angeles", true);
> Setup the final object.
> 

Thanks for your help. I'm still not clear on a few things:

1) Do I need to specify an initial cutoff for my use case here?

2) How do I specify the last Sunday of the month - is what I have done 
below correct?

3) Can I use any value for the nameKey for the recurring savings?

4) Under what conditions is the WKST (week start) specified in the RRULE 
significant?

5) Does this look correct for the VTIMEZONE information given below?

DateTimeZone vTimeZone1 = new DateTimeZoneBuilder()
   .addCutover(-2147483648, 'w', 1, 1, 0, false, 0)
   .setStandardOffset(0)
   //sets the start cutoff - is this needed?
   .addRecurringSavings("STD", 0, 1610, 2147483648, 'w',  10, -7, 1, 
true, 7200000)
   //line above says start DAYLIGHT savings on...
   // ... go back 7 days from end of month 10
   //and then forward to the first Sunday (day=1)
   .addRecurringSavings("DAY",  3600, 1610, 2147483648, 'w', 3, -7, 1, 
true, 7200000)
   //line above says start DAYLIGHT savings on...
   // ... go back 7 days from end of month 3
   //and then forward to the first Sunday (day=1)

BEGIN:VTIMEZONE
TZID:(GMT) Greenwich Mean Time - Dublin / Edinburgh / Lisbon / London
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETTO:-0000
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=10;BYDAY=-1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T010000
TZOFFSETTO:+0100
TZOFFSETFROM:-0000
RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
END:VTIMEZONE


Thanks

John

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to