Skip Menu |

This queue is for tickets about the Net-Google-Calendar CPAN distribution.

Report information
The Basics
Id: 26756
Status: open
Priority: 0/
Queue: Net-Google-Calendar

Owner: Nobody in particular
Requestors: GIFF [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Subject: Timezone problems with recurring events
Download (untitled) / with headers
text/plain 1.3k
Hello, I've run into another issue with recurring events, but this one I can't quite figure out. If I have a recurring event which was created in my timezone and I try to get the next occurrence of it, it will give the correct time from my local timezone, but the timezone of the result will be in UTC For example, if I have a meeting at 11am EDT, it will say the next meeting is at 11am UTC. I'm starting off with a recurring Google Calendar event. I get the ICal part of it with the "recurrence" method, and that seems to have the right timezone. I next get the DateTime version with Data::ICal::Entry::Event's recurrence method, and that seems to be in the Floating timezone. Finally I use DateTime::Set's next method, and that seems to be in UTC. I've attached a small test program which shows the problem. The output of this program on my calendar is: Event Event Title ICal Recurrence Data::ICal::Entry::Event=HASH(0x8ed2830), starting 20070119T110000 timezone America/New_York DateTime Recurrence DateTime::Set=HASH(0x8ecf870) Min Date 2007-01-19T11:00:00 timezone DateTime::TimeZone::Floating=HASH(0x8ecf564) Max Date inf timezone DateTime::TimeZone::Floating=HASH(0x873e9d4) Next Start 2007-05-04T11:00:00 timezone DateTime::TimeZone::UTC=HASH(0x83acb34) Next End 2007-05-04T11:00:00 timezone DateTime::TimeZone::UTC=HASH(0x83acb34) Thanks for any help, ----Scott.
Subject: gctest2
Download gctest2
application/octet-stream 1.5k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 109b
Here is the same code with proper line endings and a text/plain MIME type, which might make it easier to see.
text/plain 1.5k
#!/usr/bin/perl use warnings; use strict; use Net::Google::Calendar; use Data::Dumper; use DateTime::Format::ICal; use Data::ICal::DateTime; use DateTime; use constant CALURL => ''; use constant CALUSER => 'google_user'; use constant CALPASS => 'google_pass'; my $now = DateTime->now(); my $cal = Net::Google::Calendar->new(url => CALURL) or die "Couldn't create calendar"; $cal->login(CALUSER,CALPASS) or die "Couldn't log in"; my @mycals = $cal->get_calendars() or die "Couldn't get my calendars\n"; foreach my $c (@mycals) { $cal->set_calendar($c); foreach my $e ($cal->get_events()) { if (my $recur = $e->recurrence) { print "\nEvent ",$e->title,"\n"; my($start,$end); print "ICal Recurrence $recur, starting ",$recur->properties->{dtstart}[0]->value," timezone ",$recur->properties->{dtstart}->[0]->parameters->{TZID},"\n"; # print Dumper $recur; my $recur2 = $recur->recurrence; print "DateTime Recurrence $recur2\n"; print "Min Date ",$recur2->min," timezone ",$recur2->min->time_zone,"\n"; print "Max Date ",$recur2->max," timezone ",$recur2->max->time_zone,"\n"; if ($start = $recur2->next($now)) { print "Next Start ",$start," timezone ",$start->time_zone,"\n"; $end = $start->clone; if (my $dur = $recur->duration) { print "Duration $dur\n"; $end->add($dur); } print "Next End ",$end," timezone ",$end->time_zone,"\n"; } else { print "\t\t\tnever.\n"; next; } } } }
Download (untitled) / with headers
text/plain 144b
I think this is an underlying problem with Data::ICal::DateTime and I can't see a quick fix. I'm going to have to work on it some more. Sorry.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to