dvelopp
dvelopp

Reputation: 4295

Google doesn't return time zone for some calendars

I'm working with Google Calendar API V3 and have some difficulties with handling time zones provided by Google. In the documentation for calendar: Calendars Overview

It's said that time zone for calendar is optional field:

timeZone
string
The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional. However, it's also optional in CalendarList (https://developers.google.com/google-apps/calendar/v3/reference/calendarList).

What does Google assume time zone is in case time zone is not specified in both cases?

Upvotes: 1

Views: 159

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116968

Timezone is assumed to be the time zone set in the calendar itself.

Request:

GET https://www.googleapis.com/calendar/v3/calendars/primary

Response

{
 "kind": "calendar#calendar",
 "etag": "\"LOjlc76YTigzSZVQwSEE/E756z8zuickcYzaOnj8krCN4-Pk\"",
 "id": "[email protected]",
 "summary": "[email protected]",
 "timeZone": "Europe/Copenhagen"
}

Created new calendar without setting the timezone results in

{
 "kind": "calendar#calendar",
 "etag": "\"W8S50vTLOjlc76YTigzSZVQwSEE/cBQwQ2pDeiLoQ406eiNPZrDEINc\"",
 "id": "[email protected]",
 "summary": "testone",
 "timeZone": "UTC"
}

Upvotes: 2

Related Questions