在我的程序中,我使用google-api-python-client連接到日曆API。 我爲事件在未來3天的查詢:發生Google日曆週期性事件(Python API)的時間
service = build(serviceName='calendar', version='v3', http=http)
events = service.events().list(
calendarId=calendarId,
timeMin='2013-01-04T00:00:00+01:00',
timeMax='2013-01-06T00:00:00+01:00').execute()
結果的事件列表,仿照Python字典,大致看起來像這樣(我省略了一些不必要的數據):
{
u'created': u'2012-11-26T00:54:43.000Z',
u'description': u'abc abc',
u'start': {u'dateTime': u'2012-11-26T08:00:00+01:00',
u'timeZone': u'Europe/Copenhagen'},
u'end': {u'dateTime': u'2012-11-26T10:00:00+01:00',
u'timeZone': u'Europe/Copenhagen'},
u'kind': u'calendar#event',
u'recurrence': [u'RRULE:FREQ=DAILY'],
u'sequence': 0
}
上述事件是幾個月前創建的循環事件,「開始」和「結束」字段反映創建日期。在結果列表中會有多個此事件的副本,因爲它會在'timeMin'和'timeMax'範圍之間出現好幾次。
現在,問題是我沒有確切發生事件的日期時間(在這種情況下應爲2013-01-04T00:08:00 + 01:00)。任何人都知道我是否可以從Google Calendar API(通過python包使用版本3)獲得這段時間?
或者會建議如何在客戶端實現它?