[clock locations=”GMT”]

[clock locations=”Europe/Berlin”]

[clock locations=”America/New_York”]

[clock locations=”Asia/Bangkok”]

[clock locations=”Etc/GMT+12″]

clock.php

PHP

A plugin to display the time of various timezones as analog clocks

<?php
/*
Plugin Name: Analog Clocks
Description: A plugin to display the time of various timezones as analog clocks.
Version: 3.1.0
Author: Mike Vahldieck
Plugin URI: http://it-breeze.info
Author URI: http://it-breeze.info
License: GPL2
*/

clock.js

JAVASCRIPT
function initializeClocks(clockDataVar, instanceId) {
    const clockData = window[clockDataVar]; // Get the unique clock data for this instance

    function drawClock(canvasId, digitalId, timeZone) {
        const canvas = document.getElementById(canvasId);
        const digital = document.getElementById(digitalId);
        if (!canvas || !digital) {
            console.error(`Canvas or digital time element for "${timeZone}" not found.`);
            return;
        }

clock.css

CSS
#time-display {
    text-align: center;
    margin: 20px;
}

.city-time {
    margin: 10px 0;
}

.time {
Download