The web GUI for Google Calendar has the ability to set a specific start and 
end time zone which is absolutely awesome. Is it possible to use this 
functionality from the (Python) API as well?

For example, say I got the following start and end datetime objects for an 
event I want to create:
    
*import pytz
import datetime

start_zone = pytz.timezone('Europe/London')
end_zone = pytz.timezone('Europe/Oslo')
 
start_time = datetime.datetime(2011,5,13,15,0, tzinfo=start_zone)
end_time = datetime.datetime(2011,5,13,19,0, tzinfo=end_zone)
*

My current attempt is just the following:

*event = gdata.calendar.CalendarEventEntry()*
*event.when.append(gdata.calendar.When(start_time=start_time.isoformat(), 
end_time=end_time.isoformat()))*

The resulting event  starts at 16:00 and ends at 19:00 in a calendar set to 
"GMT+0 (London)" and has no timezone data. 

This makes sense as the *start_time.isoformat()* and 
*end_time.isoformat()*returns a string with the time and the timezone offset 
(+0 and +1 
respectively). Converted to London time (which is UTC+1 due to daylight 
savings time) these start and end times are correct compared to the 
isoformat strings, although not what I wanted.

-- 
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://code.google.com/apis/calendar/community/forum.html

Reply via email to