Skip to content

Happy New Year

New Year Special!

FLAT

40%

OFF

Ends in

Days
Hours
Get Discount!
  • Pricing
  • Features
  • Docs
  • Blog
  • My Account
  • Contact
Get Started

Getting Started

  • Install and Activate eRoom Free & eRoom Pro
  • System Requirements
  • Configuring the plugin
  • License Activation
  • License Upgrading
  • Meeting Reports
  • Meetings Grid
  • How to Add Meetings to Page
  • How to Add Meetings
  • How to Add New Users

Zoom Integration

  • How to Obtain APIs
  • Webinars
  • Migration Wizard

Google Meet Integration

  • Google Meet Addon

Microsoft Teams Integration

  • Microsoft Team Integration

Purchasable Meeting

  • Purchasable Meetings Addon

Recurring Meeting

  • Recurring Meetings Addon

Hooks

  • Filter: eroom_date_timezone_display
View Categories
  • Documentation
  • Hooks
  • Filter: eroom_date_timezone_display

Filter: eroom_date_timezone_display

This filter allows you to customize the complete date and timezone display HTML for meetings and webinars on the frontend.

Description #

This filter is applied in the meeting/webinar single page template when displaying the meeting date and timezone information.

Parameters #

ParameterTypeDescription
$date_timezone_htmlstringThe complete HTML output for date and timezone display
$formatted_datestringThe formatted date string (e.g., “December 27, 2025 10:28 PM”)
$timezone_displaystringThe timezone display string based on settings (e.g., “(GMT-05:00)”, “(GMT-05:00) EST”, or “(GMT-05:00) Eastern Time (US and Canada)”)
$post_idintThe meeting or webinar post ID
$dateDateTimeDateTime object for the meeting start time with timezone
$time_zonestringThe timezone identifier (e.g., “America/New_York”, “Europe/London”)
$webinarboolWhether this is a webinar (true) or meeting (false)

Default Output #

By default, the filter outputs:

<b>
    December 27, 2025 10:28 PM
    <span class="timezone">(GMT-05:00) EST</span>
</b>

The timezone display format depends on the admin settings:

  • Offset only: (GMT-05:00)
  • Offset with abbreviation: (GMT-05:00) EST
  • Offset with full name: (GMT-05:00) Eastern Time (US and Canada)

Usage Examples #

Example 1: Change Date Format #

add_filter( 'eroom_date_timezone_display', function( $date_timezone_html, $formatted_date, $timezone_display, $post_id, $date, $time_zone, $webinar ) {
    // Use a different date format
    $custom_date = $date->format( 'l, F j, Y \a\t g:i A' ); // "Monday, December 27, 2025 at 10:28 PM"

    return sprintf(
        '<b>%s <span class="timezone">%s</span></b>',
        esc_html( $custom_date ),
        esc_html( $timezone_display )
    );
}, 10, 7 );

Example 2: Add Custom Styling #

add_filter( 'eroom_date_timezone_display', function( $date_timezone_html, $formatted_date, $timezone_display, $post_id, $date, $time_zone, $webinar ) {
    return sprintf(
        '<b class="meeting-datetime">
            <span class="date">%s</span>
            <span class="timezone highlight">%s</span>
        </b>',
        esc_html( $formatted_date ),
        esc_html( $timezone_display )
    );
}, 10, 7 );

Example 3: Show Countdown Timer #

add_filter( 'eroom_date_timezone_display', function( $date_timezone_html, $formatted_date, $timezone_display, $post_id, $date, $time_zone, $webinar ) {
    $now = new DateTime();
    $interval = $now->diff( $date );

    if ( $date > $now ) {
        $days_until = $interval->days;
        $countdown = sprintf( '(%d days until meeting)', $days_until );
    } else {
        $countdown = '';
    }

    return sprintf(
        '<b>%s <span class="timezone">%s</span> <span class="countdown">%s</span></b>',
        esc_html( $formatted_date ),
        esc_html( $timezone_display ),
        esc_html( $countdown )
    );
}, 10, 7 );

Example 4: Convert to User’s Local Timezone #

add_filter( 'eroom_date_timezone_display', function( $date_timezone_html, $formatted_date, $timezone_display, $post_id, $date, $time_zone, $webinar ) {
    // Get user's timezone (you might get this from user meta or browser)
    $user_timezone = 'America/Los_Angeles';

    try {
        $user_date = clone $date;
        $user_date->setTimezone( new DateTimeZone( $user_timezone ) );
        $user_formatted = $user_date->format( 'F j, Y g:i A' );
        $user_offset = $user_date->format( 'P' );

        return sprintf(
            '<b>
                <span class="meeting-time">%s</span>
                <span class="timezone">%s</span>
                <br>
                <small class="your-timezone">Your time: %s (GMT%s)</small>
            </b>',
            esc_html( $formatted_date ),
            esc_html( $timezone_display ),
            esc_html( $user_formatted ),
            esc_html( $user_offset )
        );
    } catch ( Exception $e ) {
        return $date_timezone_html;
    }
}, 10, 7 );

Example 5: Different Display for Webinars vs Meetings #

add_filter( 'eroom_date_timezone_display', function( $date_timezone_html, $formatted_date, $timezone_display, $post_id, $date, $time_zone, $webinar ) {
    if ( $webinar ) {
        // Special formatting for webinars
        return sprintf(
            '<b class="webinar-time">
                <span class="icon">🎥</span> %s <span class="timezone">%s</span>
            </b>',
            esc_html( $formatted_date ),
            esc_html( $timezone_display )
        );
    }

    // Default formatting for meetings
    return $date_timezone_html;
}, 10, 7 );

Example 6: Add iCal Download Link #

add_filter( 'eroom_date_timezone_display', function( $date_timezone_html, $formatted_date, $timezone_display, $post_id, $date, $time_zone, $webinar ) {
    $ical_url = add_query_arg( 'ical_export', '1', get_permalink( $post_id ) );

    return sprintf(
        '<b>
            %s <span class="timezone">%s</span>
            <a href="%s" class="add-to-calendar" download>📅 Add to Calendar</a>
        </b>',
        esc_html( $formatted_date ),
        esc_html( $timezone_display ),
        esc_url( $ical_url )
    );
}, 10, 7 );

Important Notes #

  • Always use proper escaping functions like esc_html(), esc_attr(), and esc_url() when outputting data
  • The $date parameter is a PHP DateTime object, so you can use all DateTime methods and formatting options
  • The timezone display respects the admin setting from eRoom → Settings → General Settings → Timezone Display Format
  • Make sure to return the filtered value, not echo it

Related #

  • Admin Setting: eRoom → Settings → General Settings → Timezone Display Format
  • Class Method: `TimezoneHelper::get_display()` – Helper method that generates the timezone display string

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
Filter: eroom_date_timezone_displayFilter: eroom_date_timezone_display
Table of Contents
  • Description
  • Parameters
  • Default Output
  • Usage Examples
    • Example 1: Change Date Format
    • Example 2: Add Custom Styling
    • Example 3: Show Countdown Timer
    • Example 4: Convert to User's Local Timezone
    • Example 5: Different Display for Webinars vs Meetings
    • Example 6: Add iCal Download Link
  • Important Notes
  • Related

Sell Zoom or Google Meet sessions directly on WordPress with eRoom. Manage, monetize, and embed meetings with ease!

Resources
Blog
Documentation
Support
Get in touch
  • support@nocatwp.com

© eRoom WordPress Plugin. All Rights Reserved.

  • Terms of Service
  • Privacy Policy