views:

26

answers:

1

Hi, I am trying to send an outlook appointment from an ASP.NET website. I have found the code for sending this here, and tried to implement it. But for some unknown reason it is not working properly.

My server onto which the code is running is in US/Central timezone. I want to send this appointment to clients who are in London. So there are a Daylight savings issue here, which need to be resolved.

I haven't found any understandable explanation about the strings that are making up the appointment. I think the timezone issue could be resolved with TZOFFSETFROM and TZOFFSETTO, but since I don't know how these things work, I couldn't understand what to do.

Can someone please explain those things in plain English?

Edit

Here is the portion of the string that are being used to calculate the timezone -

string timezone = "BEGIN:VTIMEZONE"
                  + "\r\n" + "TZID:US/Central"
                  + "\r\n" + "X-MICROSOFT-CDO-TZID:11" 
                  + "\r\n" + "BEGIN:STANDARD"
                  + "\r\n" + "DTSTART:16010101T020000" 
                  + "\r\n" + "TZOFFSETFROM:-0500"
                  + "\r\n" + "TZOFFSETTO:-0600" 
                  + "\r\n" + "RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU"
                  + "\r\n" + "END:STANDARD" 
                  + "\r\n" + "BEGIN:DAYLIGHT" 
                  + "\r\n" + "DTSTART:16010101T020000" 
                  + "\r\n" + "TZOFFSETFROM:-0600"
                  + "\r\n" + "TZOFFSETTO:-0500" 
                  + "\r\n" + "RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU"
                  + "\r\n" + "END:DAYLIGHT"
                  + "\r\n" + "END:VTIMEZONE";

Here these two attributes(I don't exactly know their type name, so I am using "attributes" to point to them. My apologies) are used in two places, first after BEGIN:STANDARD and after BEGIN:DAYLIGHT. Why? If I specify a start date of DTSTART;TZID=US/Central:20101006T100000Z in the BEGIN:VEVENT block, what time it would show at client's outlook who is in London?

Second Edit
OK, I now understand that this VTIMEZONE defines a specific timezone. After specifying a timezone I need to specify a time for the calender in the VEVENT section, which is DTSTART;TZID=US/Central:20100101T100000. Now should this time be current time? I mean, when specifying a time should I consider daylight saving, or just get the current time from that timezone and use it there?

Third Edit

What time should I specify in the following block -

string event = "BEGIN:VEVENT" 
               + "\r\n" + "DTSTAMP:{8}"             
               + "\r\n" + "DTSTART;TZID=US/Central:{0}"  // What time should I specify here? 
               + "\r\n" + "SUMMARY:{7}"
               .................

Should I consider daylight savings when specifying DTSTART, or should I always specify standard time and it will be automatically adjusted for daylight savings?

+1  A: 

TZOFFSETFROM is the local time offset from GMT when daylight saving time is in operation, TZOFFSETTO is the local time offset from GMT when standard time is in operation.

Lazarus
Could you take a look at the edit?
Night Shade
Read this, it'll help loads: http://www.kanzaki.com/docs/ical/vtimezone.html
Lazarus
Yeah, read it. It was really helpful. I understand that it specifies a timezone information. I just need to know that, if I specify a timezone's all the information, then what time do I need to provide in the VEVENT block? I mean, should I specify the daylight savings time when daylight savings is on, or should I always specify the standard time and it will be automatically adjusted for daylight savings?
Night Shade
I believe it should be specified in local time for the timezone indicated in the VTIMEZONE block, so not adjusted, the VTIMEZONE info provides everything necessary to transform the local time to any other timezone. DTSTARTs will tell the receiving app if the VEVENT in Daylight Savings or Standard Time, from there it knows the offsets to GMT and can then adjust out to whatever the receiving timezone is.
Lazarus