• Resolved nikkoboy

    (@nikkoboy)


    Hi,

    I’m currently faced with a problem. I need to update the timezone of all my 300 events (I recently activated the event calendar’s “Timezone Mode”). Is there a way to do this automatically or in bulk?

    I was thinking that since each event has an address (city, state, country), wouldn’t it be possible to automatically update the timezone information based on the city, country or state? I understand that since some countries are set on multiple timezones, this wouldn’t be possible to update a timezone only based on the country information (ex: China, Russia, US, Canada, Australia, Brazil, etc).

    But for events taking place in “smaller countries” like Germany, Italy, France, Japan, etc, (countries with only one timezone), wouldn’t it be possible to automatically link country names (ex: Germany) to a specific timezone (ex: Berlin)? In this case, all events with an address in Germany, would be associated to the timezone “Europe/Berlin” (even if the event is taking place in Munich or Frankfort, which are on the same timezone as Berlin).

    In this situation, exceptions would be listed as “please, update timezone manually for the following countries” (ex: China, Russia, US, Canada, Australia, Brazil, etc), while other countries set only on one timezone could be automatically set to the timezone of their capital city (ex: Europe/Rome, Europe/London, Europe/Paris, etc).

    I understand this could require some significant coding, but it would greatly simplify our lives ??

    In the meantime, would it be possible to update timezones directly from the database? I have many events set to take place in Japan, and it would be quite time-consuming to update them one by one, when I could copy/paste the same value for all tables.

    Last but not least: how do I hide the recurring occurrences of an event in /wp-admin/edit.php?post_type=tribe_events ? I’m editing events from this page, and I would like to see only the single occurrence of each event (Since I need to edit each event only once, I don’t need to see all 35 occurrences of the same event in this list). As of now, I need to remember which event I already edited, so I don’t edit the same event twice (which is impossible to remember, of course).

    Thanks for your guidance!
    Nick

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Andras Guseo

    (@aguseo)

    Hey @nikkoboy,

    Thanks for reaching out!

    Wow! That actually is not a bad idea! Would you mind posting that on our UserVoice page where we collect input from the community on what kind of features they would like? You can find it here: https://tribe.uservoice.com/

    So as you might guess, at the moment there is no solution like that in place. However, you could go into the database and with some well executed queries you can change some of those timezones.

    If you have an event with UTC timezone set, then this is what you have in the wp_postmeta table: screenshot

    If you change it to Tokyo for example, then it changes to this: screenshot

    So if you have the post_id of the events you want to change, then it would be quite easy to change in the database.

    UPDATE wp_postmeta SET _EventTimezone = "Asia/Tokyo" WHERE post_id="{post-id}";
    UPDATE wp_postmeta SET _EventTimezoneAbbr = "JST" WHERE post_id="{post-id}";

    To get the post_id for all the UTC-6 timezones easily with this query:
    SELECT * FROM wp_postmeta where meta_value = "UTC-6"

    I’m not sure if there is a better way of running the bulk-update and adding the post_ids with OR, like:
    WHERE post_id="1" OR post_id="3" or post_id="11"

    I’m not a big SQL wizard ?? but someone might have a better idea on this.

    As for hiding the recurrences in the back-end, I believe this article will be of help:
    https://theeventscalendar.com/knowledgebase/hide-recurring-event-instances-in-admin/

    Cheers,
    Andras

    Hey there! This thread has been inactive for a while so we’re going to go ahead and mark it Resolved. Please feel free to open a new thread if any other questions come up and we’d be happy to help. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Timezones: Updating event timezone in bulk’ is closed to new replies.