Okay
  Public Ticket #2880239
Timezones support
Closed

Comments

  •  2
    lalquier started the conversation

    I set a calendar to European CET (UTC+1). As a user in the US, importing the .ics file to Outlook doesn't respect the Timezone of the calendar. Instead, Outlook imports my event in EST time (UTC-6).

    I looked in the format of the generated .ics file and it is only using this line to set the timezone: X-WR-TIMEZONE:Europe/London

    Article like this one suggest a BEGIN:VTIMEZONE block before BEGIN:VEVENT in the .ics file.

    Is this a known issue? or am I doing something wrong?

  •  894
    Zhivko replied

    Hi,

    It seems Outlook indeed doesn't respect X-WR-TIMEZONE.

    Try this workaround:

    Open file wp-content / plugins / stachethemes_event_calendar / assets / php / class.export-ical.php

    and on line 29 to 34 there's this function:

        public function date_to_cal($date_string) {
            $date = new DateTime(($date_string), new DateTimeZone($this->calendar->get_timezone()));
            return $date->format('Ymd\THis');
        }

    Replace the function above with this one:

       public function date_to_cal($date_string) {
            $date = new DateTime(($date_string), new DateTimeZone($this->calendar->get_timezone()));
            
            $date->setTimezone(new \DateTimeZone('UTC'));         return $date->format('Ymd\THis\Z');
        }

    This will export the events dates relative to UTC.

    Let me know if this solution works for you.


    Stachethemes Developer