You can get the TZoffset information indirectly as follows : (a) If you get a Single event (Not an all day event), you change Google API for When class because the starttime is something like : <gd:when startTime='2007-09-11T14:00:00.000-04:00' endTime='2007-09-11T15:00:00.000-04:00'/> and you can get the -04:00 from it which is the UTC offset.
(b) If you get a Recurring event, it is a bit difficult because you should not rely on Times collection since it may have events occurences spanning from Savings to Standard or vice-versa. You should look into <gd:recurrence> and parse it Since the ical string it contains, has the information for UTCOffsets based on the TZID and i couldnt get a good parser for it. <gd:recurrence>DTSTART;TZID=Pacific/Auckland:20071001T083000 DTEND;TZID=Pacific/Auckland:20071001T103000 RRULE:FREQ=DAILY;COUNT=10;INTERVAL=1 BEGIN:VTIMEZONE TZID:Pacific/Auckland X-LIC-LOCATION:Pacific/Auckland BEGIN:DAYLIGHT TZOFFSETFROM:+1200 TZOFFSETTO:+1300 TZNAME:NZDT DTSTART:19700927T020000 RRULE:FREQ=YEARLY;BYMONTH=9;BYDAY=-1SU END:DAYLIGHT BEGIN:STANDARD TZOFFSETFROM:+1300 TZOFFSETTO:+1200 TZNAME:NZST DTSTART:19700405T030000 RRULE:FREQ=YEARLY;BYMONTH=4;BYDAY=1SU END:STANDARD END:VTIMEZONE </gd:recurrence> HTH. Cheers Kulvinder Singh ----- Original Message ---- From: jobless <[EMAIL PROTECTED]> To: Google Calendar Data API <[email protected]> Sent: Wednesday, October 24, 2007 9:25:56 AM Subject: Re: How to retrieve the current time zone setting from a calendar Hi All, Thanks for you input. [EMAIL PROTECTED] The problem is I am collecting the agenda for a day and trying to determine the time zone offset. If there are no events scheduled there is no way to obtain the time zone offset. So when I try and new events using the API, I have no option but to add the event using the users current time zone. This causes problems in the event start time and end time. One work around I thought about was to add a simple event in the current time zone, retrieve it and then get the time zone offset value. Is there any other way to do it? On Oct 23, 12:41 pm, "Austin (Google)" <[EMAIL PROTECTED]> wrote: > Hi, > > Thanks for your the input DPM and you are correct in your assessment. > But if you really want to get the UTC offset, there is a roundable way > to do that. Since all events and its start/end time description is > normalized to the calendar timezone UTC offset, therefore if you take > an event within a calendar and parse out the trailing part of the iCal > string of its start time you will get something like -07:00 (pacific > daylight saving offset). > > Hope it helps, > Austin > > On Oct 23, 8:37 am, DPM <[EMAIL PROTECTED]> wrote: > > > > > Being technical for a moment, "America/Chicago" IS the timezone. > > > TIMEZONE = > > 1) UTC offset > > 2) rules to determine daylight savings offset > > > #2 is the kicker. It also happens to change. [ie - in the US, up to > > the 2nd sunday of march, but last year it was 1st sunday of april. #1 > > is -7 for california during half the year, but -8 during the other.] > > > As such, if you try to summarize it down to 1 number, you will get it > > wrong half the time. > > > On Oct 23, 5:41 am, jobless <[EMAIL PROTECTED]> wrote: > > > > Hello All, > > > > I am using JavaScript and trying to extract the time zone value from > > > the feed returned by Google calendar when a query is performed. The > > > problem is I am getting a value like America/Chicago and not the UTC > > > offset! Is it possible to get the time zone offset for a calendar? > > > > Thank you for any suggestions. > > > > Regards, > > > Jobless- Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Calendar Data API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-calendar-help-dataapi?hl=en -~----------~----~----~----~------~----~------~--~---
