c# - VCALENDAR .ics file issue -


i have .ics file set calendar ehtry outlook 2010 when end user registers course. server location on east coast (orhas est zone). however, 2 regions application is both in central standard time zone (cst) , mountain standard time zone (mst). issue when calendar entry set in outlook if course startime cst , user registering mst zone calender entry set 2 hours ahead of actual start time. example course starts @ 10:30 , register course , in mst zone. outlook calendar entry sets course start @ 8:30 instead of 9:30 am. also, if course mst zone , mst zone course set hour behind course start time. example class in start @ 2:00 pm mst register course , in mst outlook calendar entry set entry @ 3:00 pm when should 2:00 pm code below:`

//create body in vcalendar format string caldateformat = "yyyymmddthhmmssz"; string bodycalendar = "begin:vcalendar\r\nmethod:request\r\nprodid:microsoft cdo microsoft exchange\r\nversion:2.0\r\nbegin:vtimezone\r\nx-microsoft-cdo-tzid:11\r\nbegin:standard\r\ndtstart:16010101t020000\r\ntzoffsetfrom:-0500\r\ntzoffsetto:-0600\r\nrrule:freq=yearly;wkst=mo;interval=1;bymonth=11;byday=1su\r\nend:standard\r\nbegin:daylight\r\ndtstart:16010101t020000\r\ntzoffsetfrom:-0600\r\ntzoffsetto:-0500\r\nrrule:freq=yearly;wkst=mo;interval=1;bymonth=3;byday=2su\r\nend:daylight\r\nend:vtimezone\r\nbegin:vevent\r\ndtstamp:{8}\r\ndtstart:{0}\r\nsummary:{7}\r\nuid:{5}\r\nattendee;role=req-participant;partstat=needs-action;rsvp=true;cn=\"{9}\":mailto:{9}\r\naction;rsvp=true;cn=\"{4}\":mailto:{4}\r\norganizer;cn=\"{3}\":mailto:{4}\r\nlocation:{2}\r\ndtend:{1}\r\ndescription:{7}\\n\r\nsequence:1\r\npriority:5\r\nclass:\r\ncreated:{8}\r\nlast-modified:{8}\r\nstatus:confirmed\r\ntransp:opaque\r\nx-microsoft-cdo-busystatus:busy\r\nx-microsoft-cdo-insttype:0\r\nx-microsoft-cdo-intendedstatus:busy\r\nx-microsoft-cdo-alldayevent:false\r\nx-microsoft-cdo-importance:1\r\nx-microsoft-cdo-ownerapptid:-1\r\nx-microsoft-cdo-attendee-critical-change:{8}\r\nx-microsoft-cdo-owner-critical-change:{8}\r\nbegin:valarm\r\naction:display\r\ndescription:reminder\r\ntrigger;related=start:-pt00h15m00s\r\nend:valarm\r\nend:vevent\r\nend:vcalendar\r\n"; bodycalendar = string.format(bodycalendar,             start.touniversaltime().tostring(caldateformat),             end.touniversaltime().tostring(caldateformat),             location,             organizername,             organizeremail,             guid.newguid().tostring("b"),             summary,             subject,             datetime.now.touniversaltime().tostring(caldateformat),             attendeelist.tostring());  alternateview calendarview = alternateview.createalternateviewfromstring(bodycalendar, calendartype); calendarview.transferencoding = transferencoding.sevenbit; msg.alternateviews.add(calendarview); 

and code offset eastern time zone:

if ((state == "co" || state == "wy" || state == "mt") && classtimezone == "mst") {     startdate = startdate + timespan.parse("2:00");     enddate = enddate + timespan.parse("2:00"); } else if ((state == "co" || state == "wy" || state == "mt") && classtimezone == "cst") {     startdate = startdate + timespan.parse("1:00");     enddate = enddate + timespan.parse("1:00"); } else if ((state == "nd" || state == "sd" || state == "ks" || state == "ne" || state == "mo" || state == "ia") && classtimezone == "mst") {     startdate = startdate + timespan.parse("2:00");     enddate = enddate + timespan.parse("2:00"); } else if ((state == "nd" || state == "sd" || state == "ks" || state == "ne" || state == "mo" || state == "ia") && classtimezone == "cst") {     startdate = startdate + timespan.parse("1:00");     enddate = enddate + timespan.parse("1:00"); } 


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -