Meeting Invitation .NET MeetingRequest.CreateMeetingRequest question

Asked By 40 points N/A Posted on -
qa-featured

Hello,

I am having a really weird problem with the time showing up in my event calendars sent via asp.net page. The trouble is it appears to work just fine on my local machine and development server but not on the production server. The times showing up when sent from production server is adjusted one hour ahead of schedule. Basically a user registries for a class and gets a meeting invite in outlook with the class start and end date and time. Here is my code:

if (starttime.ToShortDateString() != "1/1/0001" && endtime.ToShortDateString() != "1/1/0001" && timezone.Length > 0)

 
            {
                TimeSpan offset = TimeZoneInfo.FindSystemTimeZoneById(LD_General.getTimeZoneID(timezone)).BaseUtcOffset;
 
                DateTimeOffset dtoStart = new DateTimeOffset(starttime.Year, starttime.Month, starttime.Day, starttime.Hour, starttime.Minute, 0, offset);
 
                dtoStart = TimeZoneInfo.ConvertTime(dtoStart, TimeZoneInfo.Local);
 
                starttime = dtoStart.DateTime;
 
                DateTimeOffset dtoEnd = new DateTimeOffset(endtime.Year, endtime.Month, endtime.Day, endtime.Hour, endtime.Minute, 0, offset);
 
                dtoEnd = TimeZoneInfo.ConvertTime(dtoEnd, TimeZoneInfo.Local);
 
                endtime = dtoEnd.DateTime;
 
                meetingInviteBody += "<html><head></head><body>";
                meetingInviteBody += "Hello, </br></br>";
                
               
                meetingInviteBody += "Your enrollment status in the above mentioned class is <strong>enrolled</strong>.</br></br>";
                   
                
                meetingInviteBody += "<br /><br /><a href='" + registerURL + "'>Cancel Registration</a>";
                meetingInviteBody += "</body></html>";
 
 
                MailMessage msg = MeetingRequest.CreateMeetingRequest(starttime, endtime, Course.getClassName(classScheduleID, true), meetingInviteBody, location, "Name of School", "********extranet@*****.com", attendeeName, attendeeEmail);
 
 
                SmtpClient c = new SmtpClient();
                try
                {
                    c.Send(msg);
                }
                catch { }
                finally { }
            }
 
 
All machines are running Windows Sever 2003 Standard Edition with SP2.
 
Any insight would be greatly appreciated.
SHARE
Best Answer by Johnny Unitas
Best Answer
Best Answer
Answered By 0 points N/A #95015

Meeting Invitation .NET MeetingRequest.CreateMeetingRequest question

qa-featured

Well the most important factors regarding the problem would be the location of the server and the following time zone. Also you must be able to locate the offset and determine the proper value. The value should match up with the time zone and should adjust to daylight savings also. Furthermore, make sure to differentiate working and failing programs within the Database. Finally, the most important things that have to be determined are the values of {starttime.Hour, endtime.Hour}. You first must determine these values which thus than proceeds {ConvertTime} which would than run upon dtostart/dtoend. The above solution should fix the problem.

Answered By 15 points N/A #95016

Meeting Invitation .NET MeetingRequest.CreateMeetingRequest question

qa-featured

The problem might be as a result of the time differences between the local machine and the time that you have set on the server. Since there is a time difference of one hour, then that will be the reason as to why users seem to get wrong invitations for meetings at the wrong time. When the invitation is send, it will be bearing the time on the local server and therefore that time will be the one that will be used at the destination and therefore causing the conflicts. You will therefore be needed to adjust the date on the remote server and the local server so that they tally to avoid those problems.

-Clair Charles

Related Questions