I believe there may be an issue with the DateTime output in the conversions.rb file. As it currently is, no timezone data is output in the string ie: DTSTART:20061218T180000 I''ve found by changing these lines: # UTC time gets a Z suffix if utc s << "Z" end to s << self.zone I get a line like this: DTSTART:20061218T180000Z Which is then properly handled by my ICS consumer (Google Calendar and ICal). Does this seem like a valid fix or am I missing some other timezone support? Thanks, Greg Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/icalendar-devel/attachments/20070122/ecc9370d/attachment.html
Just went through the spec again to figure out how this works, and it''s a bit of a pain. There are two options for specifying time in an ical file. If you use local time, then you just use the regular format and you do not include a ''Z''. If you are specifying the time in UTC then you include the ''Z''. Just using UTC all the time makes the most sense, to get around timezone confusions, but many people just use local time. There is another timezone format, where the UTC offset is added to the end of the string, and this is what would result if you use the fix you include. The specifically say this is not allowed in the spec though, so it probably worked for you because you are using UTC, but on my machine here in Switzerland it is different: Time.now.zone => "CET" DateTime.now.zone => "+0100" These would incorrectly add garbage to the end of the string... So yeah, I''m not sure what the best solution is. By default right now times are considered local, but maybe we should have a simple way to specify that a given calendar or calendar component is using UTC time instead? -Jeff Greg Martin wrote:> I believe there may be an issue with the DateTime output in the > conversions.rb file. > > As it currently is, no timezone data is output in the string ie: > > DTSTART:20061218T180000 > > I''ve found by changing these lines: > > # UTC time gets a Z suffix > if utc > s << "Z" > end > > to > > s << self.zone > > I get a line like this: > > DTSTART:20061218T180000Z > > Which is then properly handled by my ICS consumer (Google Calendar and > ICal). > > Does this seem like a valid fix or am I missing some other timezone support? > > Thanks, > Greg Martin > > > ------------------------------------------------------------------------ > > _______________________________________________ > icalendar-devel mailing list > icalendar-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/icalendar-devel
Yeah, I think a simple method for specifying UTC or local would probably cover 99% of the need. I have run into this because I am working with data coming out of Microsoft Exchange which as far as I can tell is always in UTC. Thanks, greg On 1/23/07, Jeff Rose <jeff at rosejn.net> wrote:> > Just went through the spec again to figure out how this works, and it''s > a bit of a pain. There are two options for specifying time in an ical > file. If you use local time, then you just use the regular format and > you do not include a ''Z''. If you are specifying the time in UTC then > you include the ''Z''. Just using UTC all the time makes the most sense, > to get around timezone confusions, but many people just use local time. > > There is another timezone format, where the UTC offset is added to the > end of the string, and this is what would result if you use the fix you > include. The specifically say this is not allowed in the spec though, > so it probably worked for you because you are using UTC, but on my > machine here in Switzerland it is different: > > Time.now.zone => "CET" > DateTime.now.zone => "+0100" > > These would incorrectly add garbage to the end of the string... > > So yeah, I''m not sure what the best solution is. By default right now > times are considered local, but maybe we should have a simple way to > specify that a given calendar or calendar component is using UTC time > instead? > > -Jeff > > Greg Martin wrote: > > I believe there may be an issue with the DateTime output in the > > conversions.rb file. > > > > As it currently is, no timezone data is output in the string ie: > > > > DTSTART:20061218T180000 > > > > I''ve found by changing these lines: > > > > # UTC time gets a Z suffix > > if utc > > s << "Z" > > end > > > > to > > > > s << self.zone > > > > I get a line like this: > > > > DTSTART:20061218T180000Z > > > > Which is then properly handled by my ICS consumer (Google Calendar and > > ICal). > > > > Does this seem like a valid fix or am I missing some other timezone > support? > > > > Thanks, > > Greg Martin > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > icalendar-devel mailing list > > icalendar-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/icalendar-devel > > _______________________________________________ > icalendar-devel mailing list > icalendar-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/icalendar-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/icalendar-devel/attachments/20070123/938d182d/attachment.html
Hi everyone, Sorry for the mailing list spam today, but I''ve been trying to get things organized and on track with icalendar while I have a bit of time again. I just posted a new release to rubyforge, and it would be great if people could upgrade their gems or download the latest tarball to let me know if you run into any problems. This round fixes a couple bugs that people have reported since the last release, so give it a try with your nastiest calendars and send in bug reports if you find problems. Cheers, and thanks a lot for your contributions and feedback! -Jeff
On Jan 23, 2007, at 12:42 PM, Jeff Rose wrote:> Just went through the spec again to figure out how this works, and > it''s > a bit of a pain. There are two options for specifying time in an ical > file. If you use local time, then you just use the regular format and > you do not include a ''Z''. If you are specifying the time in UTC then > you include the ''Z''. Just using UTC all the time makes the most > sense, > to get around timezone confusions, but many people just use local > time.Using UTC all the time sounds like a good idea, but you run into problems with recurrence rules (like an event on first Monday of every month, where the UTC time is actually Sunday, will skip any Monday that falls on the 1st of the month).> So yeah, I''m not sure what the best solution is. By default right now > times are considered local, but maybe we should have a simple way to > specify that a given calendar or calendar component is using UTC time > instead?I''d like to see all the timezone related stuff tied into the tzinfo gem, and actually add proper VTIMEZONE definitions. Brandon -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/icalendar-devel/attachments/20070123/54824003/attachment.bin