Home › Forums › Calendar Products › Events Calendar PRO › Imported events show wrong time zone
- This topic has 8 replies, 2 voices, and was last updated 6 years, 2 months ago by Tim Parry.
-
AuthorPosts
-
January 20, 2018 at 7:02 pm #1431634Tim ParryParticipant
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?
January 22, 2018 at 1:47 pm #1432871AndrasKeymasterHello 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,
AndrasJanuary 23, 2018 at 6:13 pm #1434225Tim ParryParticipantThanks – they are all the calendars from ctreg14.org
http://www.ctreg14.org/cf_calendar/feed.cfm?type=ical&cals=0,102
January 24, 2018 at 2:17 am #1434408AndrasKeymasterHi 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,
AndrasJanuary 26, 2018 at 1:48 pm #1437535Tim ParryParticipantThanks. 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’
);January 26, 2018 at 2:35 pm #1437604Tim ParryParticipantI tried this and came up with a bunch of syntax errors
February 6, 2018 at 3:20 pm #1445751AndrasKeymasterHi 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,
AndrasFebruary 28, 2018 at 8:35 am #1466041Support DroidKeymasterHey 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 -
AuthorPosts
- The topic ‘Imported events show wrong time zone’ is closed to new replies.