• When I click on the Add to Calendar and try to add it to my calendar the start and end times are off by 7 hours. For a 7pm start time on the event (the correct time) the ics calendar entry is 12pm. I am in a GMT -7 time zone.

    Why doesn’t the Add to Calendar provide the correct time?

    It seems there is no timezone support for the ics generated by evr_ics.php.

    Will this be fixed in a future release?

    Also I found that there is a typo in the evr_ics.php file in the line for the header content (line 60). This has been there for a few versions.

    Please correct the word Calendar in the Content-Type line.

    //This is the most important coding.
    header("Content-Type: text/Caledar");
    header("Content-Disposition: inline; filename=".rawurlencode($event_name).".ics");

    https://www.ads-software.com/plugins/event-registration/

Viewing 1 replies (of 1 total)
  • Thread Starter AllanE

    (@allane)

    So after digging some more I came up with a solution for adding the time zone to the evr_ics.php. BUT this will only work for events taking place in one time zone unless someone creates a function to determine what time zone the event is in or the time zone data is stored and passed from database and incorporated.

    This temporary solution is based on information from the following post:
    https://erics-notes.blogspot.com/2013/05/fixing-ics-time-zone.html

    In the evr_ics.php file add the block of code for your time zone. I added a block for Phoenix (with php syntax) right above the line that has “BEGIN:VEVENT\n” :

    //added timezone handling 6-4-15
    echo "BEGIN:VTIMEZONE\n";
    echo "TZID:America/Phoenix\n";
    echo "X-LIC-LOCATION:America/Phoenix\n";
    echo "BEGIN:STANDARD\n";
    echo "TZOFFSETFROM:-0700\n";
    echo "TZOFFSETTO:-0700\n";
    echo "TZNAME:MST\n";
    echo "DTSTART:19700101T000000\n";
    echo "END:STANDARD\n";
    echo "END:VTIMEZONE\n";
    //end adding time zone handling

    Also change the end and start times based on your time zone.

    from this

    "DTEND:".date("Ymd",strtotime($end_date))."T".date("His",strtotime($end_time))."\n";

    to this

    echo "DTEND;TZID=America/Phoenix:".date("Ymd",strtotime($end_date))."T".date("His",strtotime($end_time))."\n";

    Do the same for the start date:

    echo "DTSTART;TZID=America/Phoenix:".date("Ymd",strtotime($start_date))."T".date("His",strtotime($start_time))."\n";

    I hope this helps someone…

Viewing 1 replies (of 1 total)
  • The topic ‘Add to Calendar event time incorrect’ is closed to new replies.