Import XML reading UTC timezone instead of Los Angeles
My site is importing several event feeds from Eventlink and the individual events get set to the timezone of UTC which they should not. The events are actually Los Angeles (PST) timezone. (note – this is UTC -8 or UTC -7 depending on the time of year). I looked at the code of one of the .ics files and I think I see the issue but not sure what to do about it.
BEGIN:VCALENDAR PRODID:-//Google Inc//Google Calendar 70.9054//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:PUBLISH X-WR-CALNAME:Army and Navy Academy X-WR-TIMEZONE:UTC BEGIN:VTIMEZONE TZID:America/Los_Angeles X-LIC-LOCATION:America/Los_Angeles BEGIN:DAYLIGHT TZOFFSETFROM:-0800 TZOFFSETTO:-0700 TZNAME:PDT DTSTART:19700308T020000 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU END:DAYLIGHT BEGIN:STANDARD TZOFFSETFROM:-0700 TZOFFSETTO:-0800 TZNAME:PST DTSTART:19701101T020000 RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU END:STANDARD END:VTIMEZONE BEGIN:VEVENT
As you can see in the code, the X-WR-TIMEZONE is set to UTC which I believe is what Events Calendar is using as the event timezone during import. What the plugin is failing to do is understand that the timezone is actually -0800 or -0700 (depending on daylight savings) which is listed below it in the TZOFFSETFROM and TZOFFSETTO.
There are also several other spots in the code that show that this should be PDT if you look at the items for TZID, X-LIC-LOCATION, or TZNAME.
3 attached screenshots:
1) screenshot of an imported event on our calendar that shows the import timezone as UTC.
2) screenshot of Event Calendar timezone settings (Events > Settings > General)
3) screenshot of WordPress timezone is set to Los Angeles for this site under Settings > General
Lastly, here is the .ics feed I referenced above:
Thanks for reaching out!
I tested this and can confirm this is happening.
I have opened a bugticket so our developers can take a look at the issue.
I am going to set the status of this ticket to “pending fix” and we will update it once the fix is released.
If you have any new questions or issues please create a new ticket and we’ll help you out.
Thanks and cheers,
Thanks for pinging me.
There is no update for this bug yet. When the issue was reported and I opened the bugticket our team was already well into the development of the upcoming maintenance release, which will be the last one this year, so it did not make it into that one.
After this MR is released we will start scoping the bugs for the next one, but that will likely only happen in the new year, so I need to ask for a bit of patience from you. Thanks!
One additional note to this issue – We have noticed that when our iCalendar feed is imported if the event is an “All Day” event then the above issue happens where the event is converted to UTC time by plugin. If the event has a specific time (10:30am-11:30am for example) then the time is kept in Los Angeles, PST.
Thanks for sharing that extra info.
I ran some further tests and if the time is defined like this:
Then the timezone will be taken into account. Otherwise it is skipped even though it is defined at the beginning.
We’ll take a look at it.
Thanks for your patience so far.
A couple of devs went through the issue and we had a discussion about this. Here is the result.
1) the calendar in question (https://calendar.google.com/calendar/ical/b0bkgetcceub0ijrvqcns05q3im8dagv%40import.calendar.google.com/public/basic.ics) defines a timezone for the whole calendar using the
That timezone is “UTC”.
2) The calendar then defines a timezone identified with “America/Los_Angeles” in a “VTIMEZONE” block; contrary to popular belief this is not the calendar timezone but just the data about a timezone one or more event in the feed might use.
3) Where the file does not specify that the “America/Los_Angeles” timezone should be used then the calendar-wide one, “UTC”, will be used; this applies, for example, to the “ACT Tests (on campus)” event.
The event DTSTART and DTEND attribute are not, in fact, specifying a TZID; importing this event will correctly assign it the “UTC” timezone.
4) There are two events in the feed that do use the “America/Los_Angeles” timezone, e.g. the “REC HALL OPEN” one; preview from the 2017-08-01 date to get it.
Importing any instance of the event will correctly set the “America/Los_Angeles” timezone on them.
The event does, in fact, use it in the date specification.
All in all, it looks like that the import works correctly.
If you would like to have more info on the VTIMEZONE specification to understand what it actually is then visit https://www.kanzaki.com/docs/ical/tzid-p.html and https://www.kanzaki.com/docs/ical/vtimezone.html.
Note that we are still having discussions about the all-day events and their handlings.
Hope this gives a bit of clarity.
Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team
The topic ‘Import XML reading UTC timezone instead of Los Angeles’ is closed to new replies.