Imported events show wrong time zone

Home Forums Calendar Products Events Calendar PRO Imported events show wrong time zone

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1431634
    Tim Parry
    Participant

    Hello, I have my settings set for the site’s default time zone. However, imported events arc coming in as UTC and not my time zone, which is UTC-5. Is there something I’m doing wrong?

    #1432871
    Andras
    Keymaster

    Hello Tim,

    Thanks for using our plugins and welcome to the forums!

    Sorry about this import issue. I’ll try to help you solve this one.

    Could you share with me the url(s) which you are trying to import? I would like to take it for a test drive.

    Thanks,
    Andras

    #1434225
    Tim Parry
    Participant
    #1434408
    Andras
    Keymaster

    Hi Tim,

    Thanks for sharing those feeds.

    I gave them a check. There is no timezone defined neither for the full feed, nor for the events themselves. In this case the events will be imported as UTC timezone.

    We have a snippet that can help you with adjusting the timezone on import. Copy it into your theme’s functions.php file, set it up for your needs and it should do the trick.

    https://gist.github.com/andrasguseo/c895e4a7755055c18148b5bbd482c1dd

    You will need to adjust the settings at the bottom in this part:

    modify_imported_event_timezones(
    'https://domain.com/events/main-calendar.ics/',
    'America/New_York'
    );

    Change your feed url. If you set it to null then it will be applied to all import feeds.
    Change the timezone. Although I haven’t tested it with ‘UTC-5’ it should work.

    A note on timezones: if you have your WordPress timezone (Settings > General) set as “UTC-5”, then you might get some time discrepancy when DST kicks in. In this case having the timezone set to “America/New_York” (or whatever your timezone is) can be the solution, as the city-based timezones do follow the DST changes automatically.

    Let me know how that works out.

    Cheers,
    Andras

    #1437535
    Tim Parry
    Participant

    Thanks. To be clear then, if all my events are New York time zone, would I change this:

    modify_imported_event_timezones(
    https://domain.com/events/main-calendar.ics/’,
    ‘America/New_York’
    );

    to this?

    modify_imported_event_timezones(
    ‘America/New_York’
    );

    #1437604
    Tim Parry
    Participant

    I tried this and came up with a bunch of syntax errors

    #1445751
    Andras
    Keymaster

    Hi Tim,

    Sorry for the delay and thanks for your patience!

    If you want it to affect all feeds, then use this:

    modify_imported_event_timezones(
    null,
    'America/New_York'
    );

    Check and let me know if that does the trick.

    Cheers,
    Andras

    #1466041
    Support Droid
    Keymaster

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Imported events show wrong time zone’ is closed to new replies.