generating ics file programmatically but never able to produce what timezone invitation was produced

852 Views Asked by At

Hi I was trying send meeting invites through my asp.net MVC application. There was a requirement to show which timezone this invite was created as in following image. I tried various things as told by Microsoft support, neither of them worked.

Meeting Invite

As per Microsoft Exchange Server support's advice I created following.

TZID:Sri Jayawardenepura
BEGIN:STANDARD 
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Sri Jayawardenepura:20140416T033000Z
DTSTAMP:20140327T113138Z
DTEND;TZID=Sri Jayawardenepura:20140416T060000Z 
LOCATION: Board room

After adding TZID inside DTSTART, it is not coming as invite to gmail.

but following works fine as invitation both in outlook configured with Exchange Server and webmails like gmail.

 TZID:Sri Jayawardenepura
BEGIN:STANDARD
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART:20140318T033000Z
DTSTAMP:20140327T122640Z
DTEND:20140318T060000Z
LOCATION: Board room

however that requirement of showing timezone where invite was created not fulfilled yet. Can anyone help me. Thanks in advance.

2

There are 2 best solutions below

1
On

If you look at http://www.kanzaki.com/docs/ical/dateTime.html it states that UTC time is identified by a Z suffix character as well as The TZID property parameter MUST NOT be applied to DATE-TIME properties whose time values are specified in UTC.

I would suspect that if you are using a timezone identifier that you need to remove the Z from the end of the date to get it to work properly.

EDIT: So, I was having troubles with timezones before as well, so I had only used UTC time, however I just got one to work with a timezone, so I hope this helps. Inside VTIMEZONE, you have a STANDARD, but you do not have a DTSTART inside the STANDARD. Again, quoting from the above link, The standard or daylight component MUST include the "DTSTART", "TZOFFSETFROM" and "TZOFFSETTO" properties.

0
On

It is not RFC5545 compliant but many calendars will expect a TZID to be compatible with the Olson DB and also may expect to have the calendar property X-WR-TIMEZONE set.

What I have seen is that when doing all of above you increase your calendar compatibility ratio.