EventEntry.Times, calendar time zone vs. local time zone

283 views
Skip to first unread message

Jed

unread,
Aug 27, 2009, 6:30:45 PM8/27/09
to Google Data APIs .NET Client Library
This message is an attempt to confirm that the Google Data APIs .NET
Client Library for Google Calendar (Google.GData.Calendar) only
returns event start and end times in the PC's local time zone. Is this
correct?

I have a calendar configured to use Central time and no matter what
ctz parameter I provide (EventQuery.TimeZone) the results are returned
in my PC's Eastern time zone. I'm assuming this is because of .NET 2
limitations (no TimeZoneInfo). If I download the calendar and review
it in a browser, the time zone is being changed correctly...

I'm brand new at this but this would seem like a major limitation for
people using the library on web servers hosted in random time zones --
am I expected to convert back to the desired/calendar time zone
myself?

I looked at this group for any discussion of timezone-related issues,
as well as the issue tracker, but did not see any mention of what may
be a C#-specific "feature". Thanks for your time.

~Jed

Frank Mantek

unread,
Sep 1, 2009, 9:18:46 AM9/1/09
to gdata-dotnet-...@googlegroups.com
What does happen is that the date values that are getting send over
the wire are converted to a local time, yes. This is not due to .NET
limitations, but it seemed to be the obvious thing to do when
converting the string to a datetime value, given the fact that we have
2 options:

a) give you a string and you parse it
b) convert it into something that you are used to, a datetime object

From what i know, there is no way to preserve the datetime/zone value
here.
And yes, you are expected to convert back to whatever timezone you
want the event to be in.

All you could do is inspect the string upfront to figure out what
timezone it is. As .NET does not have a global timezone list, this is
harder to do, but sure achievable.

Also, the .NET code was written before the calendar UI started to
support timezones, so it did not matter a bit what you set the
timezone to, as the calendar changed it into whatever the user wanted
to see....

So i guess, what you should do (simplest) is:

-> take the calendar code
-> modify the getter/setter for this to parse the timezone info (they
do this anyway, you just need to rember it), and have another getter
to get that data

Frank Mantek
Google

Reply all
Reply to author
Forward
0 new messages