【发布时间】:2018-06-29 10:57:12
【问题描述】:
我在获取谷歌生日日历时遇到问题。我在谷歌生日日历上弄错了年份。
例如: 在我的谷歌联系人中,我有联系人姓名 - 迪帕克,他的生日 - 19/04/1990。所以这个联系人生日显示在谷歌生日日历中。当我获取谷歌生日日历时,我得到的日期类似于 2017-04-19、2018-04-19、2019-04-19。如何从谷歌生日日历中获取联系人确切的生日?
来自 Google 日历 API 的响应
[0] => Array
(
[kind] => calendar#event
[etag] => "3060534890000000"
[id] => 2017_BIRTHDAY_4a7a6b868dd53910
[status] => confirmed
[htmlLink] => https://www.google.com/calendar/event?eid=MjAxN19CSVJUSERBWV80YTdhNmI4NjhkZDUzOTEwICNjb250YWN0c0B2
[created] => 2018-06-29T10:17:25.000Z
[updated] => 2018-06-29T10:17:25.000Z
[summary] => Deepak's birthday
[description] => This is Deepak's birthday!
[creator] => Array
(
[email] => #contacts@group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[organizer] => Array
(
[email] => #contacts@group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[start] => Array
(
[date] => 2017-06-30
)
[end] => Array
(
[date] => 2017-07-01
)
[visibility] => public
[iCalUID] => 2017_BIRTHDAY_4a7a6b868dd53910@google.com
[sequence] => 0
[gadget] => Array
(
[iconLink] => https://calendar.google.com/googlecalendar/images/cake.gif
[preferences] => Array
(
[goo.contactsGivenName] => Deepak
[goo.contactsEventType] => BIRTHDAY
[goo.contactsFullName] => Deepak
[goo.isGPlusUser] => false
[goo.contactsContactId] => 4a7a6b868dd53910
[goo.contactsIsMyContact] => true
)
)
[reminders] => Array
(
[useDefault] => 1
)
)
[1] => Array
(
[kind] => calendar#event
[etag] => "3060534890000000"
[id] => 2018_BIRTHDAY_4a7a6b868dd53910
[status] => confirmed
[htmlLink] => https://www.google.com/calendar/event?eid=MjAxOF9CSVJUSERBWV80YTdhNmI4NjhkZDUzOTEwICNjb250YWN0c0B2
[created] => 2018-06-29T10:17:25.000Z
[updated] => 2018-06-29T10:17:25.000Z
[summary] => Deepak's birthday
[description] => This is Deepak's birthday!
[creator] => Array
(
[email] => #contacts@group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[organizer] => Array
(
[email] => #contacts@group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[start] => Array
(
[date] => 2018-06-30
)
[end] => Array
(
[date] => 2018-07-01
)
[visibility] => public
[iCalUID] => 2018_BIRTHDAY_4a7a6b868dd53910@google.com
[sequence] => 0
[gadget] => Array
(
[iconLink] => https://calendar.google.com/googlecalendar/images/cake.gif
[preferences] => Array
(
[goo.contactsGivenName] => Deepak
[goo.contactsEventType] => BIRTHDAY
[goo.contactsFullName] => Deepak
[goo.isGPlusUser] => false
[goo.contactsContactId] => 4a7a6b868dd53910
[goo.contactsIsMyContact] => true
)
)
[reminders] => Array
(
[useDefault] => 1
)
)
[2] => Array
(
[kind] => calendar#event
[etag] => "3060534890000000"
[id] => 2019_BIRTHDAY_4a7a6b868dd53910
[status] => confirmed
[htmlLink] => https://www.google.com/calendar/event?eid=MjAxOV9CSVJUSERBWV80YTdhNmI4NjhkZDUzOTEwICNjb250YWN0c0B2
[created] => 2018-06-29T10:17:25.000Z
[updated] => 2018-06-29T10:17:25.000Z
[summary] => Deepak's birthday
[description] => This is Deepak's birthday!
[creator] => Array
(
[email] => #contacts@group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[organizer] => Array
(
[email] => #contacts@group.v.calendar.google.com
[displayName] => Contacts
[self] => 1
)
[start] => Array
(
[date] => 2019-06-30
)
[end] => Array
(
[date] => 2019-07-01
)
[visibility] => public
[iCalUID] => 2019_BIRTHDAY_4a7a6b868dd53910@google.com
[sequence] => 0
[gadget] => Array
(
[iconLink] => https://calendar.google.com/googlecalendar/images/cake.gif
[preferences] => Array
(
[goo.contactsGivenName] => Deepak
[goo.contactsEventType] => BIRTHDAY
[goo.contactsFullName] => Deepak
[goo.isGPlusUser] => false
[goo.contactsContactId] => 4a7a6b868dd53910
[goo.contactsIsMyContact] => true
)
)
[reminders] => Array
(
[useDefault] => 1
)
)
【问题讨论】:
-
日历不包含原始出生日期,它包含每个年度生日的提醒。数据没有任何“错误”,只是您找错地方了。
标签: google-api google-contacts-api google-calendar-api google-people-api