title: i want to use the ical but have few items based upon different timezones
body: <p>i had the calendar file build in very old way, i am trying to use the ical with this</p>
  <pre><code>https://gist.github.com/JamoCA/5c62d02f87c644c78b25
  </code></pre>
  <p>because i have few events which are in different <code>timezones</code> and they should appear properly in the timezone, not sure how will i be able to fix the above <code>url</code> with my code, any guidance will help</p>
  <p>i tried to use it but the values seems t be hardcoded</p>
  <pre><code>function iCalUS2(stEvent) {
      var vCal = ArrayNew(1);
      var date_now = Now();
      if (not isStruct(stEvent)){
          throw(message=&quot;invalid iCal Struct&quot;, detail=&quot;stEvent must be a struct&quot;);
      }
      if (NOT StructKeyExists(stEvent, &quot;method&quot;)) stEvent.method = &quot;REQUEST&quot;;  // PUBLISH adds directly to a custom calendar
      if (NOT StructKeyExists(stEvent, &quot;organizerName&quot;)) stEvent.organizerName = CGI.Server_Name;
      if (NOT StructKeyExists(stEvent, &quot;organizerEmail&quot;)) stEvent.organizerEmail = &quot;info@#CGI.Server_Name#&quot;;
      if (NOT StructKeyExists(stEvent, &quot;subject&quot;)) stEvent.subject = &quot;Event subject&quot;;
      if (NOT StructKeyExists(stEvent, &quot;location&quot;)) stEvent.location = &quot;Event location&quot;;
      if (NOT StructKeyExists(stEvent, &quot;description&quot;)) stEvent.description = &quot;Event description goes here
  Provide the complete event details&quot;;
      /* This value must be in Pacific time!!! */
      if (NOT StructKeyExists(stEvent, &quot;startTime&quot;))  stEvent.startTime = ParseDateTime(&quot;1/1/1999 14:30&quot;);
      if (NOT StructKeyExists(stEvent, &quot;endTime&quot;))  stEvent.endTime = ParseDateTime(&quot;1/1/1999 15:30&quot;);
      if (NOT StructKeyExists(stEvent, &quot;priority&quot;)) stEvent.priority = 1;
      if (NOT StructKeyExists(stEvent, &quot;calendarName&quot;)) stEvent.calendarName = &quot;#CGI.Server_Name# Calendar&quot;;
      if (NOT StructKeyExists(stEvent, &quot;calendarDescription&quot;)) stEvent.calendarDescription = &quot;Event Calendar for #CGI.Server_Name#&quot;;
      if (NOT StructKeyExists(stEvent, &quot;timeZone&quot;)) stEvent.timeZone = &quot;America/Los_Angeles&quot;;
      if (NOT StructKeyExists(stEvent, &quot;status&quot;)) stEvent.status = &quot;&quot;;
      if (NOT StructKeyExists(stEvent, &quot;sequence&quot;)) stEvent.sequence = 0; // Track qty of updates to an event (optional)
      if (NOT StructKeyExists(stEvent, &quot;uid&quot;)) stEvent.uid = &quot;#date_now.getTime()#.#CGI.Server_Name#&quot;;
      if (NOT StructKeyExists(stEvent, &quot;lastmodified&quot;)) stEvent.lastmodified = &quot;&quot;;
      arrayAppend(vCal, &quot;BEGIN:VCALENDAR&quot;);
      arrayAppend(vCal, &quot;VERSION:2.0&quot;);
      arrayAppend(vCal, &quot;PRODID: -//SunStar Media//iCalUS//EN&quot;);
      arrayAppend(vCal, &quot;METHOD:#Ucase(stEvent.method)#&quot;);
      if (stEvent.method IS &quot;request&quot;){
          arrayAppend(vCal, &quot;X-MS-OLK-FORCEINSPECTOROPEN:TRUE&quot;);
      }   
      arrayAppend(vCal, &quot;X-WR-CALNAME:#ical_escape_text(stEvent.calendarName)#&quot;);
      arrayAppend(vCal, &quot;X-WR-TIMEZONE:US/Pacific&quot;);
      arrayAppend(vCal, &quot;X-WR-RELCALID:#stEvent.uid#&quot;);
      arrayAppend(vCal, &quot;X-WR-CALDESC:#ical_escape_text(stEvent.calendarDescription)#&quot;);
      arrayAppend(vCal, &quot;BEGIN:VTIMEZONE&quot;);
      arrayAppend(vCal, &quot;TZID:US/Pacific&quot;);
      arrayAppend(vCal, &quot;BEGIN:STANDARD&quot;);
      arrayAppend(vCal, &quot;DTSTART:20061101T020000&quot;);
      arrayAppend(vCal, &quot;RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11&quot;);
      arrayAppend(vCal, &quot;TZOFFSETFROM:-0800&quot;);
      arrayAppend(vCal, &quot;TZOFFSETTO:-0700&quot;);
      arrayAppend(vCal, &quot;TZNAME:Pacific Time&quot;);
      arrayAppend(vCal, &quot;END:STANDARD&quot;);
      arrayAppend(vCal, &quot;BEGIN:DAYLIGHT&quot;);
      arrayAppend(vCal, &quot;DTSTART:20060301T020000&quot;);
      arrayAppend(vCal, &quot;RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3&quot;);
      arrayAppend(vCal, &quot;TZOFFSETFROM:-0800&quot;);
      arrayAppend(vCal, &quot;TZOFFSETTO:-0700&quot;);
      arrayAppend(vCal, &quot;TZNAME:Daylight Savings Time&quot;);
      arrayAppend(vCal, &quot;END:DAYLIGHT&quot;);
      arrayAppend(vCal, &quot;END:VTIMEZONE&quot;);
      arrayAppend(vCal, &quot;BEGIN:VEVENT&quot;);
      arrayAppend(vCal, &quot;UID:#stEvent.uid#&quot;);  // creates a unique identifier
      if (isDate(stEvent.lastmodified)){
          arrayAppend(vCal, &quot;LAST-MODIFIED:#DateFormat(stEvent.lastmodified,'yyyymmdd')#T#TimeFormat(stEvent.lastmodified,'HHmmss')#&quot;);
      }
      arrayAppend(vCal, &quot;ORGANIZER;CN=#ical_escape_text(stEvent.organizerName)#:MAILTO:#stEvent.organizerEmail#&quot;);
      arrayAppend(vCal, &quot;DTSTAMP:#DateFormat(date_now,'yyyymmdd')#T#TimeFormat(date_now,'HHmmss')#&quot;);
      arrayAppend(vCal, &quot;DTSTART;TZID=US/Pacific:#DateFormat(stEvent.startTime,'yyyymmdd')#T#TimeFormat(stEvent.startTime,'HHmmss')#&quot;);
      arrayAppend(vCal, &quot;DTEND;TZID=US/Pacific:#DateFormat(stEvent.endTime,'yyyymmdd')#T#TimeFormat(stEvent.endTime,'HHmmss')#&quot;);
      if (LEN(stEvent.status)){
          arrayAppend(vCal, &quot;STATUS:#ucase(stEvent.status)#&quot;);
      }
      arrayAppend(vCal, &quot;SEQUENCE:#VAL(stEvent.sequence)#&quot;);
      arrayAppend(vCal, &quot;SUMMARY:#ical_escape_text(stEvent.subject)#&quot;);
      arrayAppend(vCal, &quot;LOCATION:#ical_escape_text(stEvent.location)#&quot;);
      arrayAppend(vCal, &quot;DESCRIPTION:#ical_escape_text(stEvent.description)#&quot;);
      if (Find(&quot;&lt;&quot;, stEvent.description)) {
          arrayAppend(vCal, &quot;X-ALT-DESC;FMTTYPE=text/html:#Request.ical_escape_text(stEvent.description, 'html')#&quot;);
      }
      if (stEvent.status NEQ &quot;CANCELLED&quot;){
          arrayAppend(vCal, &quot;X-MICROSOFT-CDO-BUSYSTATUS:BUSY&quot;);
          arrayAppend(vCal, &quot;X-MICROSOFT-CDO-IMPORTANCE:2&quot;);
      }
      arrayAppend(vCal, &quot;PRIORITY:#stEvent.priority#&quot;);
      arrayAppend(vCal, &quot;TRANSP:OPAQUE&quot;);
      arrayAppend(vCal, &quot;CLASS:PUBLIC&quot;);
      arrayAppend(vCal, &quot;BEGIN:VALARM&quot;);
      arrayAppend(vCal, &quot;TRIGGER:-PT30M&quot;);  // alert user 30 minutes before meeting begins
      arrayAppend(vCal, &quot;ACTION:DISPLAY&quot;);
      arrayAppend(vCal, &quot;DESCRIPTION:Reminder&quot;);
      arrayAppend(vCal, &quot;END:VALARM&quot;);
      arrayAppend(vCal, &quot;END:VEVENT&quot;);
      arrayAppend(vCal, &quot;END:VCALENDAR&quot;);
      return Trim(arrayToList(vCal, &quot;#chr(13)##chr(10)#&quot;));
  }
  </code></pre>
  <p>I am doing it like this in my code for Timing,</p>
  <pre><code>&quot;DTSTAMP:&quot; DateFormat(now(),&quot;yyyymmdd&quot;) &amp; &quot;T&quot; &amp; TimeFormat(now(), &quot;HHmmss&quot;);
  &quot;DTSTART:&quot; DateFormat(startime,&quot;yyyymmdd&quot;) &amp; &quot;T&quot; &amp;                  TimeFormat(starttime, &quot;HHmmss&quot;);
  </code></pre>
  <p>so my biggest concern is to use the timezone with the vtimezone instead of using it globally on the top, because events can have seperate timezones</p>
  <p>This is my current code as of now</p>
  <pre><code>BEGIN:VCALENDAR 
  VERSION:2.0 PRODID: -//iCalUS()//EN 
  X-WR-CALNAME:My Calendar 
  X-WR-TIMEZONE:America/new York 
  X-WR-CALDESC: 
  BEGIN:VEVENT 
  UID:5739453945 
  DTSTAMP:20181203T214510 
  DTSTART:20181126T070000 
  DTEND:20181126T100000 
  SUMMARY: anything i specify 
  LOCATION:Online 
  DESCRIPTION:what is written here 
  END:VEVENT 
  END:VCALENDAR
  </code></pre>
  <p>i want to move the timezone to VTimezone but it lots of other values which i do not know how can i add those and i want to remove the value from the TOP</p>
  <p>X-WR-TIMEZONE:America/new York because i have multiple events happening in different timezones</p>
  <p>please guide</p>