User69488508 posted
Hi:
I am able to generate a calendar successfully however, if someone from a different timezone accepts it does not adjust to their timezone. Does anyone know how I can compensate for this in the following code?
TrainingStart = Convert.ToDateTime(ReturnValue4);
TrainingEnd = TrainingStart.AddMinutes(30);
//Initialization
MemoryStream mStream = new MemoryStream();
StreamWriter sw = new StreamWriter(mStream);
sw.AutoFlush = true;
//Header
sw.WriteLine("BEGIN:VCALENDAR");
sw.WriteLine("VERSION:2.0");
sw.WriteLine("PRODID:-//Flo Inc.//FloSoft//EN");
sw.WriteLine("BEGIN:VEVENT");
//Body
sw.WriteLine("DTSTART:" + TrainingStart.ToString("s"));
sw.WriteLine("DTEND:" + TrainingEnd.ToString("s"));
sw.WriteLine("LOCATION:" + Location);
sw.WriteLine("X-ALT-DESC;FMTTYPE=text/html:" + Description.Replace("\n", " "));
sw.WriteLine("SUMMARY:" + Subject);
//Footer
sw.WriteLine("PRIORITY:" + Priority);
sw.WriteLine("END:VEVENT");
sw.WriteLine("END:VCALENDAR");
//Make it Downloadable
Response.Clear();
Response.AppendHeader("Content-Disposition", "attachment; filename=Add2Calendar.ics");
Response.AppendHeader("Content-Length", mStream.Length.ToString());
Response.ContentType = "html/x-vCalendar";
//Response.ContentType = "application/download";
Response.BinaryWrite(mStream.ToArray());
Response.End();
sqlcon.Close();