locked
timezone and date of my appointment dose not work correctly???? RRS feed

  • Question

  • hello my friends
    I have write a application that send appointment to outlook with asp.net and c#.i need to send date in shamsi date format,and my time zone set to tehran GMT(+03:30).but timezone and date dose not work correctly.for example when i send an appointment with start time=06.30 and end time=12.00 ,the client receive start time=12.30 and end time=1.30, and date dose not receive in shamsi date format!!!
    my code is:
                sbICSFile.AppendLine("BEGIN:VCALENDAR");
                sbICSFile.AppendLine("VERSION:2.0");
                sbICSFile.AppendLine("PRODID:-//Tehran/");
                sbICSFile.AppendLine("BEGIN:VEVENT");
                sbICSFile.AppendLine("BEGIN:VTIMEZONE");
                sbICSFile.AppendLine("TZID:Tehran/IR");
                sbICSFile.AppendLine("BEGIN:STANDARD");
                sbICSFile.AppendLine("DTSTART:20090923T020000");          
                sbICSFile.AppendLine("TZOFFSETFROM:+0330");
                sbICSFile.AppendLine("TZOFFSETTO:+0430");
                sbICSFile.AppendLine("TZNAME:EST");
                sbICSFile.AppendLine("END:STANDARD");
                sbICSFile.AppendLine("BEGIN:DAYLIGHT");
                sbICSFile.AppendLine("DTSTART:20090321T020000");        
                sbICSFile.AppendLine("TZOFFSETFROM:+0430");
                sbICSFile.AppendLine("TZOFFSETTO:+0330");
                sbICSFile.AppendLine("TZNAME:Tehran");
                sbICSFile.AppendLine("END:DAYLIGHT");
                sbICSFile.AppendLine("END:VTIMEZONE");

                DateTime d = calStartDate.SelectedDate;
                SHAMSIDATE sd = Jalali.MiladiToShamsi(d.Month, d.Day, d.Year);

                sbICSFile.Append("DTSTART;TZID=" + "Tehran/IR" + ":");
                sbICSFile.Append(sd.iYear);
                sbICSFile.Append(
                    FormatDateTimeValue(sd.iMonth));
                sbICSFile.Append(
                    FormatDateTimeValue(sd.iDay) + "T");
                sbICSFile.AppendLine(ddlStartTime.SelectedValue);

                sbICSFile.Append("DTEND;TZID=" + ":");
                sbICSFile.Append(sd.iYear);
                sbICSFile.Append(
                    FormatDateTimeValue(sd.iMonth));
                sbICSFile.Append(
                    FormatDateTimeValue(sd.iDay) + "T");
                sbICSFile.AppendLine(ddlEndTime.SelectedValue);

    please help me to solve this problems.please.
    thanks.
    Thursday, August 27, 2009 7:15 PM

All replies