# Team Time Zones Widget

> Adds a dashboard widget showing the current local time for each office or teammate you list, next to the site's own time, so scheduling across time zones is easier.

- Type: PHP
- Runs: Admin only
- Category: [Dashboard](https://wpide.com/library/category/dashboard/)
- Tags: dashboard-widget, time-zones, team
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/dash-team-time-zones-widget/

## Code

```php
// Label => PHP time zone name.
$wpide_team_zones = array(
    'London'   => 'Europe/London',
    'New York' => 'America/New_York',
    'Sydney'   => 'Australia/Sydney',
);

add_action( 'wp_dashboard_setup', function () use ( $wpide_team_zones ) {
    wp_add_dashboard_widget( 'wpide_team_zones', 'Team time zones', function () use ( $wpide_team_zones ) {
        $format = get_option( 'time_format' );
        $zones  = array( 'Site time' => wp_timezone() );
        foreach ( $wpide_team_zones as $label => $zone ) {
            try {
                $zones[ $label ] = new DateTimeZone( $zone );
            } catch ( Exception $e ) {
                continue;
            }
        }

        echo '<table class="widefat striped"><tbody>';
        foreach ( $zones as $label => $zone ) {
            $now = new DateTime( 'now', $zone );
            printf(
                '<tr><td>%s</td><td style="text-align:right"><strong>%s</strong> <small style="color:#646970">%s</small></td></tr>',
                esc_html( $label ),
                esc_html( wp_date( $format, $now->getTimestamp(), $zone ) ),
                esc_html( wp_date( 'D', $now->getTimestamp(), $zone ) )
            );
        }
        echo '</tbody></table>';
    } );
} );
```

## Notes

Use PHP time zone names such as Europe/London or America/New_York in $wpide_team_zones.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Team Time Zones Widget" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
