views:

22

answers:

2

Hi,

I am migrating Calendars to Google Apps using Google API Version 2 for .NET as below:

EventEntry entry    = new EventEntry();
entry.Title.Text    = "Test Calendar";
When   eventTime    = new When(StartDate, EndDate, false);

I am setting : : StartDate = {6/18/2010 3:00:00 PM} EndDate = {6/18/2010 4:00:00 PM}

But after migration it is setting Calendar Date and Time as:

StartDate = 6/18/2010 9:30am EndDate = 6/18/2010 10:30am

I tried with changing my Calendar Time Zone value to "(GMT + 00:00) GMT (no daylight saving)" also.But issue remain same.

How to resolve this issue?

Thanx

A: 

What are you expecting your "3 pm" to be? UTC or local?

I admit I don't know what the Google Calendar API expects or will convert it to - but I would suggest you try specifying the UTC time of the event.

Did your previous code work in v1? Do you have a sample program which can easily be toggled between v1 and v2, showing them behaving differently? (If you can create such a program, I can try to get to the bottom of it internally.)

Jon Skeet
I want to set Time to Local.I never used V1.How can i specify time zone here?
Preeti Singh
@Preeti: You don't specify the time zone for a one-off event - it only makes sense for a recurrent event. However, if you want your DateTime to be viewed as local for the purposes of specifying the one-off time of this event, specify `DateTimeKind.Local` in the constructor to `DateTime`. At least give it a try :)
Jon Skeet
thanx it works now.
Preeti Singh
A: 

I'm getting similar situation:

event = gdata.calendar.CalendarEventEntry()
event.title = atom.Title(text="Task: ")
event.content = atom.Content(text="Working hours")
aux_start_time = datetime.datetime(start_date.year, start_date.month, start_date.day, start_time.hour, start_time.minute, start_time.second).strftime('%Y-%m-%dT%H:%M:%S+00:00')
aux_end_time = datetime.datetime(start_date.year, start_date.month, start_date.day, self.pause_start.hour, self.pause_start.minute, self.pause_start.second).strftime('%Y-%m-%dT%H:%M:%S+00:00')
event.when.append(gdata.calendar.When(start_time=aux_start_time, end_time=aux_end_time))

After event is added the time is +1 hour? Why this is happening?

Serhiy