WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Daylight Saving Time problem (59 posts)

  1. ianbutty
    Member
    Posted 2 years ago #

    I wonder if anyone can help. When I enter events after the clocks go back in December in to event manager. The times display incorrectly in Google Calendar when using the ical feed.

    Compare the following:
    http://www.ians-studio.co.uk/calendar/ Look at the two events on Friday 28th October and 4th November both at 19:00.
    If you import the calendar feed: http://www.ians-studio.co.uk/events.ics in to google calendar you will see the time for the 4th November event is shown at 18:00.

    The clocks go back in the UK on 30th October. All events after that time in Google calendar via the ics feed are out by one hour.

    Can anyone advice on how to fix this?

    Thanks,
    Ian.

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    are you using the latest version 4.212? also can you try this post http://wordpress.org/support/topic/plugin-events-manager-ics-and-time-zones?replies=15

  3. ianbutty
    Member
    Posted 2 years ago #

    Latest version is installed. The more I look at this though the more I think it is to do with the fact that wordpress as a whole has no concept of daylight saving time. So at the moment the timezone is for WP is set to UTC+1 because I'm in daylight saving time. Google calendar does know about daylight saving and automagically changes the time when it reads the ICS file.

    This is becoming a BIG BIG issue for me - because I need to make my google calendar available to clients so that they can seen when they can book the studio but all events after the clock go back are are shown with the wrong times.

    Anyone got any suggestions??

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    just checked, works fine for me.

    actually, it might be a PHP/server issue, as WP takes its info from there, so if your server isn't taking DST into account it might give bad date results.

  5. ianbutty
    Member
    Posted 2 years ago #

    Marcus,
    This is still a big issue for me. Once daylight saving changed at the end of October all the events in google calendar shifted to the correct time. I'm now starting to see the problem again as I start to enter events after the spring time change.

    Can you elaborate more on your comment about it being a PHP/Server issue and give me some indication as to how I might solve this.

    Ultimately I want to move to the paid version of event manager for some of the additional functionality it gives but I really need to get this resolved before I can do that.

    Any help you can offer would be appreciated.
    Ian.

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    Servers calculate their PHP time based on the server clock, and some php settings in your php.ini file. Depending on your settings there, it may be that your server times are not right, hence EM getting the wrong date values.

    If you contacted your hosts (or try it on another host) hopefully this should resolve itself once you fix your server time.

  7. ianbutty
    Member
    Posted 2 years ago #

    Sorry to be a pain but I am confused. The time in EM *IS* correct on my server - I don't have any problems on the server... the problem appears to be with how the .ics file is interpreted by Google Calendar.

    This is an entry in the ics file after daylight savings change:

    BEGIN:VEVENT
    UID:e79b311e-6407-401e-b390-f68fcebfa0e9
    DTSTART:20120406T190000Z
    DTEND:20120406T220000Z
    DTSTAMP:20111206T125646Z
    SUMMARY:Good Friday - NO Friday Night at the Studio Event - Ian's Studio - 6 Apr 12 19:00
    LOCATION:#_LOCATION
    URL:http://www.ians-studio.co.uk/events/event/good-friday-no-friday-night-at-the-studio-event/
    END:VEVENT

    As you can see it is being exported as being 19:00 till 22:00. But when Google calendar imports the event it imports as running 20:00 till 23:00.

    Looking at the header of the ics file I have the following:

    BEGIN:VCALENDAR
    VERSION:2.0
    METHOD:PUBLISH
    CALSCALE:GREGORIAN
    PRODID:-//Events Manager//1.0//EN
    X-WR-CALNAME:Ian's Studio - Calendar

    I won't pretend to really understand the ics file format but I would expect to see a TZID tag daylight savings specification to say what timezone the calendar is for and when daylight savings starts.

    When the ics is imported into Google calendar a calendar timezone of "GMT+00:00) GMT (no daylight saving)" is set with no way to change this.

    Some ics files I've looked at have the following included in in the header seciton:

    BEGIN:VTIMEZONE
    TZID:Europe/London
    BEGIN:DAYLIGHT
    TZOFFSETFROM:+0000
    TZOFFSETTO:+0100
    DTSTART:19810329T010000
    RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
    TZNAME:BST
    END:DAYLIGHT
    BEGIN:STANDARD
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0000
    DTSTART:19961027T020000
    RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
    TZNAME:GMT
    END:STANDARD
    END:VTIMEZONE

    Nothing like this appears in the ics file generated by EM.

  8. ianbutty
    Member
    Posted 2 years ago #

    Ok, I've been doing some research and I think I can see where the problem is:

    I've created two ICS files. This first one is as generated by EM:

    BEGIN:VCALENDAR
    VERSION:2.0
    METHOD:PUBLISH
    CALSCALE:GREGORIAN
    PRODID:-//Events Manager//1.0//EN
    X-WR-CALNAME:IMB Test Calendar
    BEGIN:VEVENT
    UID:949d32c0-9e00-4e86-a8f4-b0ee95399ae3
    DTSTART:20120311T190000Z
    DTEND:20120311T220000Z
    DTSTAMP:20111108T091634Z
    SUMMARY:Introduction to Wedding Photography Workshop - Ian's Studio - 11 Mar 12 19:00
    LOCATION:#_LOCATION
    URL:http://www.ians-studio.co.uk/events/event/introduction-to-wedding-photography-workshop-2/
    END:VEVENT
    BEGIN:VEVENT
    UID:e79b311e-6407-401e-b390-f68fcebfa0e3
    DTSTART:20120406T190000Z
    DTEND:20120406T220000Z
    DTSTAMP:20111206T125646Z
    SUMMARY:Good Friday - NO Friday Night at the Studio Event - Ian's Studio - 6 Apr 12 19:00
    LOCATION:#_LOCATION
    URL:http://www.ians-studio.co.uk/events/event/good-friday-no-friday-night-at-the-studio-event/
    END:VEVENT
    END:VCALENDAR

    When this is imported in to Google Calendar the first entry appears at 19:00 the second event at 20:00

    This is the second ics file:

    BEGIN:VCALENDAR
    VERSION:2.0
    METHOD:PUBLISH
    CALSCALE:GREGORIAN
    PRODID:-//Events Manager//1.0//EN
    X-WR-CALNAME:IMB Test Calendar
    BEGIN:VEVENT
    UID:949d32c0-9e00-4e86-a8f4-b0ee95399ae2
    DTSTART:20120311T190000
    DTEND:20120311T220000
    DTSTAMP:20111108T091634
    SUMMARY:Introduction to Wedding Photography Workshop - Ian's Studio - 11 Mar 12 19:00
    LOCATION:#_LOCATION
    URL:http://www.ians-studio.co.uk/events/event/introduction-to-wedding-photography-workshop-2/
    END:VEVENT
    BEGIN:VEVENT
    UID:e79b311e-6407-401e-b390-f68fcebfa0e2
    DTSTART:20120406T190000
    DTEND:20120406T220000
    DTSTAMP:20111206T125646
    SUMMARY:Good Friday - NO Friday Night at the Studio Event - Ian's Studio - 6 Apr 12 19:00
    LOCATION:#_LOCATION
    URL:http://www.ians-studio.co.uk/events/event/good-friday-no-friday-night-at-the-studio-event/
    END:VEVENT
    END:VCALENDAR

    When this one is imported BOTH events start correctly at 19:00.

    The only difference between the two files that the second one does NOT have the "Z" suffix on the times. It appears that the "Z" suffix forces google calendar to take the time as UTC/GMT and not as 'local' or 'daylight correct' time.

    I don't know what causes the "Z" suffix to be added. Is it a server setting, a wordpress setting or an EM setting.

    In addition to all this looking at the ics file generated by EM the LOCATION is being set to "#_LOCATION" and not to the location specified in EM.

    Any suggestions for resolving this would be welcomed.

    Thanks
    Ian.

  9. kazerin
    Member
    Posted 2 years ago #

    @ianbutty

    hey, I'm working with a slightly older version but I do see Z appear in my EM's /templates/ical.php

    $dateStart = date('Ymd\THis\Z',$EM_Event->start - (60*60*get_option('gmt_offset')));
    $dateEnd = date('Ymd\THis\Z',$EM_Event->end - (60*60*get_option('gmt_offset')));
    $dateModified = date('Ymd\THis\Z', $EM_Event->modified);
  10. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    Z has to be there. It is UTC time which is calculated according to your blog settings.

    Viewing the two dates side by side fromt he first ical:

    DTSTART:20120311T190000Z
    DTSTART:20120406T190000Z

    My guess is you have a DST issue here, hence the hour being off on the second one. I'd say the second ical is wrong, and google is calculating it an hour off (which may seem correct but it's not).

    That said, I'm looking into another user with a similar time display problem, If I find an issue related to EM will fix (or might have more solutions as to why it's happening)

  11. Bucketsaway
    Member
    Posted 2 years ago #

    Hi all,

    I'm discovering this same issue with my blog right now with the upcoming DST change. I have the latest events plugin, and the latest wordpress, and my host is dreamhost.

    Marcus, did you encounter any solution while working on your other problem?

    Thanks!

  12. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    these days I'm not coming across any timezone problems like this anymore (at least not for now... :/) does your timezone settings take DST into account?

  13. ianbutty
    Member
    Posted 2 years ago #

    I can confirm that this continues to be a major problem for me. As far as I can tell my web host, wordpress and google calendar all take DST in to account.

    Other ics files that I load into google calendar all work fine across DST changes. So I don't believe the problem can be at the google end.

    I don't see anything odd happening with DST anywhere else on the wordpress installation. If there are any specifice WP or server settings that I need to check please tell me and I will check them.

    Thanks.
    Ian.

  14. raskull
    Member
    Posted 2 years ago #

    As it happens... I have a massive schedule of events (100+) coming up this weekend (DST!) on a site that will be visited by a lot of people (50,000+) with a button for each event to add to google calendar. I sure hope it still works come Sunday 2:00 am, or I'm in for a major FAIL!

  15. raskull
    Member
    Posted 2 years ago #

    Okay, maybe this is obvious, but the first thing I'm doing in preparation is changing from a UTC setting to a city-in-my-time-zone setting. That seems like it will take care of things on the WordPress front. Checking in with my server next...

  16. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    I still maintain this is a problem on your server/site. For example - http://demo.wp-events-plugin.com/

    This is a GMT-localized blog, and my CET calendar adjusts the times fine.

  17. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    btw, @ianbutty, make sure you haven't got a ical template overriding the default, maybe my fixes aren't being applied to your site.

  18. raskull
    Member
    Posted 2 years ago #

    Well, here we are:

    I am using #_EVENTGCALURL. My WordPress install is set to a city in my timezone.

    Today is the day before daylight savings time. Tomorrow we "spring ahead" one hour.

    If today I "add to my google calendar" an event happening at 10:00 am today, all is good.

    If today I "add to my google calendar" an event happening at 10:00 am tomorrow (which is after DST has kicked in), the event shows up as 11:00 am.

    The same thing happens with ical.

    Tomorrow I will have to see whether events on tomorrow's google calendar will "heal" themselves overnight (i.e. what appears incorrectly today as 11:00 am Sunday, will appear correctly tomorrow as 10:00 am Sunday.) But I doubt it.

    This random site I found does seem to pass the correct value: http://chicagoheights.patch.com/events?when=2012-03-16. These events have additional parameters in the urls, but I'm not sure what they control.

  19. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    did the demo ical work for you?

  20. raskull
    Member
    Posted 2 years ago #

    Did not see the demo before but I just tried it now. Exact same problem, for both google and ical:

    Daylight savings time ends Nov 4 2012.

    Event on Oct 27 2012 (before DST ends) from 6-8pm goes in accurately.

    Event on Nov 17 2012 (after DST ends) from 6-8pm goes in 5-7pm.

  21. raskull
    Member
    Posted 2 years ago #

    I did come across something that said the location parameter in the url is important in calculating the time. I don't know if that's true or not but I do see that EM is using the EM location title, rather than the location's physical address.

    Come to think of it, I just noticed that the events don't have an address and mapable location when they import. That is definitely needed in the url parameters, for location if not time.

  22. abdulmannan
    Member
    Posted 2 years ago #

    Hi every one.Please help me as I am new on WordPress I just wanted to have a link of download to download the event calender , so any one can get it in his/her outlook or google calender.I using a event-manager plugin.Any help would be greatly appreciated.Thanks

  23. agelonwl
    Member
    Posted 2 years ago #

    @abdulmannan

    can you post it separately?

  24. abdulmannan
    Member
    Posted 2 years ago #

    Thanks for quick response agelonwl.
    I have finally solved my issue as now in my event calendar I managed to show the Google calendar button under every event.Thanks a lot anyway.

  25. raskull
    Member
    Posted 2 years ago #

    Yeah, so anyway... along with the location title, the location address must appear in the url parameters. Otherwise the event doesn't have an address when it gets to google or ical. And therefore it doesn't have a map. And rumor has it that adding location might solve the DST problem.

  26. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    These are the neil young events compared to my google calendar, set to spanish time:
    Event on Oct 27 2012 - local time: 6pm - google: 8pm (wrong, I think)
    Event on Nov 17 2012 - local time: 6pm - google: 7pm (correct)

    Different things for both of us. I think it might also take into account DST change dates, e.g. one country changes earlier than others, meaning a bigger gap on some days.

    Will have to investigate further.

  27. ianbutty
    Member
    Posted 2 years ago #

    Marcus, if you want another example to compare I am happy to supply any information you need.

    Event in WP: http://www.ians-studio.co.uk/events/band-night/
    Google calendar: https://www.google.com/calendar/b/0/embed?src=o1g3u7ouupmjjmfuirm63j18e5fbi0ag@import.calendar.google.com&ctz=Europe/London

    Happy to supply any settings you need - just tell me what you need.

    Ian.

  28. raskull
    Member
    Posted 2 years ago #

    @ianbutty -- This looks like the same problem I was having with my recent events; events occuring post-DST but entered pre-DST were going in an hour late. With my test above, it was the opposite, as would be expected; events occuring while DST is in effect, but entered while it was not, go in an hour early. Events both occurring and entered within the same DST cycle are fine. @Marcus -- I think your results are the same as mine; I think the time for the second event is wrong.

    I think this behavior is NOT an EM bug. However I take it at face value, until testing proves otherwise, that google (as I read somewhere -- wish I could remember where) compensates for this natural problem by using event location (GEO/ADDRESS) as a work-around. Can we give google a fighting chance by passing the address?

  29. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    since I can now reproduce this my side, fixing it shouldn't be a problem. the only issue is time, this one will be a time-consumer due to repeated testing loading calendars etc. on google. Just thinking about it hurts my head :)

    I agree with raskull that it might not be an EM bug, as we don't take DST into account, yet it corrects itself at one point automatically. Again, some time will be needed to test this.

    I may punt this fix for the next update (not to panic! updates are usually a week or so apart) because aside from a load of bugfixes and kinks ironed out, a lot of new features are getting done now that take far less time to sort out.

  30. ianbutty
    Member
    Posted 2 years ago #

    That is great news Marcus! As I've said before if you need me to supply and data that will help I'm more than happy to do so.

    I'm sure your processes will take care of this, but I have to ask anyhow - I assume the same fix will get applied to the paid-for version, as I am considering upgrading to that version in the future.

    Thanks again,
    Ian.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic