On Tue, Aug 09, 2005 at 11:36:47AM +0100, Simon Wistow said:
> Which is all lovely and groovy but, since releasing, I've had the
> feeling that my TimeZone support is bogus - not least because if I do
> 
>       $span->set_time_zone('Europe/London');
> 
> then I can wildly different results even though all the events in the 
> calendar have that TZID

I've found some oddness

With this VEVENT 

BEGIN:VEVENT
DTSTART;TZID=Europe/London:20050801T090000
DTEND;TZID=Europe/London:20050801T130000
SUMMARY:Mailman Day Reminder
UID:DF51C24D-0408-11DA-A793-000A9599EB44
SEQUENCE:7
DTSTAMP:20050803T102342Z
RRULE:FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=1
END:VEVENT


If I do this

my $start =  DateTime::Format::ICal->parse_datetime('20050801T130000');
$start->set_time_zone('Europe/London');

my $recur = DateTime::Format::ICal->parse_recurrence(
                                recurrence => 
'FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=1',
                                dtstart => $start);

$recur->set_time_zone('Europe/London');

my $date1 = DateTime->new( year => 2005, month => 6, day => 27 );
my $date2 = DateTime->new( year => 2005, month => 10, day => 27 );
my $span  = DateTime::Span->from_datetimes(start=>$date1, end=>$date2);


my $int = $recur->intersection($span);

while (my $dt = $int->next) {
        print $dt->ymd."\n";
}


then I get

2005-08-01
2005-09-01

but then 

2005-10-02

If I remove the $start->set_time_zone then I get 01 as expected. If I 
keep the $start->set_time_zone but lose the $recur->set_time_zone then I 
don't get it at all?

I'm baffled.

Could it be that my DateTime::* installation is horked? Or, as I 
suspect, am I doing something hideously wrong and/or misunderstanding 
something?

Simon




Reply via email to