How to Display Timezone Information with Display Eventbrite Events

When displaying Eventbrite events on your WordPress site, you may want to include timezone information alongside the event date and time. This is particularly important for online events or when your audience spans multiple time zones.

Why Timezone Display Requires Custom Code

Eventbrite doesn’t store timezone data in a standard format that’s immediately usable for display purposes. The plugin receives timezone information from Eventbrite’s API, but it needs to be processed and formatted to be user-friendly. This requires using WordPress filters to customize how the time information is displayed.

Basic Timezone Display Implementation

To display timezone information with your events, you’ll need to add custom code to your site. The safest approach is to add this code to your child theme’s functions.php file or use a code snippet plugin.

Step 1: Add the Main Timezone Filter

PHP
add_filter( 'wfea_event_time', function ( $out, $start, $end, $args ) {
    $date_format = get_option( 'date_format' ) . ', ';
    $time_format = get_option( 'time_format' );
    $combined_format = $date_format . $time_format;

    if ( false === $args || ( isset( $args['show_end_time'] ) && $args['show_end_time'] ) ) {
        // Determine if the end time needs the date included (for multi-day events)
        $end_time = ( $start->local !== $end->local ) 
            ? mysql2date( $combined_format, $start->local ) 
            : mysql2date( $time_format, $end->local );
    } else {
        $end_time = '';
    }

    // Assemble the full event time string with timezone
    $start_time     = esc_html( mysql2date( $combined_format, $start->local ) );
    $start_timezone = ! empty( $end_time ) ? '' : apply_filters( 'wfea_custom_timezone_name', ( $start->timezone ) );
    $separator      = empty( $end_time ) ? '' : apply_filters( 'wfea_event_time_separator', '-', $args );
    $end_timezone   = apply_filters( 'wfea_custom_timezone_name', ( $end->timezone ) );
    $event_time     = $start_time . ' ' . $start_timezone . $separator . ' ' . esc_html( $end_time ) . ' ' . $end_timezone;

    return $event_time;
}, 10, 4 );

This filter overrides the default event time display to include timezone information. It handles both single-day and multi-day events appropriately.

Advanced: Converting to Standard Timezone Codes

By default, Eventbrite provides timezone information in formats like America/New_York or Europe/London. You may prefer to display these as standard 3-character timezone codes like EST or GMT for better readability.

Step 2: Add Timezone Conversion Filter (Optional)

PHP
add_filter( 'wfea_custom_timezone_name', function ( $timezone_string ) {
    // Array of common timezone mappings
    $timezone_mappings = [
        'Asia/Singapore'      => 'SGT',
        'America/New_York'    => 'EST',
        'America/Chicago'     => 'CST',
        'America/Denver'      => 'MST',
        'America/Los_Angeles' => 'PST',
        'Europe/London'       => 'GMT',
        'Europe/Paris'        => 'CET',
        'Asia/Tokyo'          => 'JST',
        'Australia/Sydney'    => 'AEST',
        'Pacific/Auckland'    => 'NZST',
        'America/Toronto'     => 'EST',
        'Europe/Berlin'       => 'CET',
        'Asia/Dubai'          => 'GST',
        'Asia/Kolkata'        => 'IST',
        // Add more mappings as needed for your events
    ];

    try {
        // First check if we have a direct mapping
        if ( isset( $timezone_mappings[ $timezone_string ] ) ) {
            return $timezone_mappings[ $timezone_string ];
        }

        // If no direct mapping, try to get it from PHP's DateTime
        $dateTime     = new \DateTime( 'now', new \DateTimeZone( $timezone_string ) );
        $abbreviation = $dateTime->format( 'T' );

        // If we got a valid abbreviation (3+ characters), return it
        if ( strlen( $abbreviation ) >= 3 ) {
            return $abbreviation;
        }

        // If we couldn't get a valid abbreviation, return the original string
        return $timezone_string;

    } catch ( \Exception $e ) {
        // If there's any error, return the original string
        return $timezone_string;
    }
}, 10, 1 );

Customizing the Timezone Mappings

The timezone mappings array can be customized to include any specific timezones relevant to your events. Common additions might include:

PHP
'America/Vancouver'   => 'PST',
'Europe/Amsterdam'    => 'CET',
'Asia/Hong_Kong'      => 'HKT',
'Australia/Melbourne' => 'AEST',
'Pacific/Honolulu'    => 'HST',

Implementation Methods

Method 1: Child Theme Functions.php

Add the code to your active child theme’s functions.php file. This ensures the customization survives theme updates.

Method 2: Code Snippet Plugin

Use a plugin like “Code Snippets” to add the code safely without editing theme files directly.

Method 3: Custom Plugin

For sites with multiple developers or complex requirements, create a small custom plugin containing this functionality.

Example Output

With these filters in place, your event times will display as:

  • Before: March 15, 2025, 2:00 PM - 4:00 PM
  • After: March 15, 2025, 2:00 PM EST - 4:00 PM EST

Or with timezone conversion:

  • Before: March 15, 2025, 2:00 PM - 4:00 PM
  • After: March 15, 2025, 2:00 PM EST - 4:00 PM EST

Compatibility Notes

  • This solution works with all plugin layouts except Short Date – this woudl require changing the template part short_date_title_time.php ( see customising layout )
  • The timezone display respects your WordPress date and time format settings unless overridden
  • Multi-day events are handled appropriately
  • The code includes error handling to prevent site crashes if timezone data is unavailable

Troubleshooting

If timezone information isn’t displaying as expected:

  1. Ensure your Eventbrite events have timezone information set
  2. Check that your code is properly added to functions.php or your snippet plugin
  3. Clear any caching plugins after implementing the changes
  4. Test with a simple event first before applying to all events

Need Help?

If you encounter issues implementing this solution or need assistance with customization, please contact our support team with:

  • A link to the page where events are displayed
  • The shortcode you’re using
  • Details about your desired timezone display format
  • Any error messages you’re encountering

See Also:

Was this helpful?