Back to posts ↺

DMTT earth visualized


- licensed under CC0 1.0

I’ve had some discussions with people about the practical use of decimal time and its implications, and sometimes it’s really hard to discuss these kinds of topics without visualizing what you’re talking about in some way. In the process of discussing this, a friend even found an error in one of my previous articles that has been up for more than a year and a half, so it’s obviously not an easy subject. I don’t know how one and a half year passed already since my first article about time - Is it fair to blame time? - but I intended to continue the time series with some more follow-ups, so here’s the first one.

A heads-up; I know some of my readers - like me - are browsing the web with Javascript disabled for privacy considerations. This blog will never have any kind of trackers, but I still understand if you decide to not enable Javascript for this domain. In that case you have to imagine the passing of time yourself as the examples run in Javascript.

Common time system

Creating the “common” clocks in Javascript was very easy. Just run a function on an interval that creates a Date object for ‘now’, and the hour-, minute- and second-variables can be easily retrieved. Because the “setInterval” function in Javascript doesn’t run exactly on the defined millisecond interval, some jumping of seconds was visible, so instead of updating the clock every second it gets updated 10 times every second.

As a reference here the common clock displaying your current local time. It seems a bit useless to put it here - you’re not going to use this website as a clock I hope - but it is useful to compare it with the next clock.

function updateCommonTime() {
    var now = new Date();

    var currentHour = now.getHours().toString().padStart(2, '0');
    if (commonH.innerHTML !== currentHour) {
        commonH.innerHTML = currentHour;
    }

    var currentMinutes = now.getMinutes().toString().padStart(2, '0');
    if (commonM.innerHTML !== currentMinutes) {
        commonM.innerHTML = currentMinutes;
    }

    var currentSecond = now.getSeconds().toString().padStart(2, '0');
    if (commonS.innerHTML !== currentSecond) {
        commonS.innerHTML = currentSecond;
    }
}

updateCommonTime();
setInterval(updateCommonTime, 1000 / 10);
// A seconds takes 1000ms, but because of lag that differs between browsers the deviation from the current time can make the browser catch up with skipping seconds.
// To make this less obvious we refresh 10 times as much, so a skip is 10 times as common but only a 10th of the amount and less noticeable. </script>

Local DMTT

To calculate the local time in DMTT we need to do some calculations. There is not (yet) a javascript API available that can convert common time to DMTT. The best we can is calculate the local time based on the elapsed milliseconds since the start of the day. To get those, we have to call the same functions as the above clock, and do some multiplications;

Δtin ms = (Δs + (Δm * 60) + (Δh * 60 * 60)) * 1000 + Δms

Where

Δtin ms = number of milliseconds since the start of the day
Δh = number of hours since start of the day
Δm = number of minutes since start of the hour
Δs = number of seconds since start of the minute
Δms = number of milliseconds since start of the second

To get to the current time in ticks we need to find the proportion of elapsed number of seconds vs the total number of seconds in a day (86400) times the total number of ticks in a day (1000 or 1 kt). We therefor have to divide the number of elapsed milliseconds by 864 (86400 milliseconds in a day vs 1000 ticks in a day).

Δtin ticks = Δtin ms / 864

function updateDMTTLocal() {
    var now           = new Date();
    var milliSeconds  = (now.getSeconds() + (now.getMinutes() * 60) + (now.getHours() * 60 * 60)) * 1000 + now.getMilliseconds();
    var centiTick     = Math.floor(milliSeconds / 864000 * 1000);
    var tickOnly      = Math.floor(centiTick / 100);
    var centiTickOnly = centiTick - (tickOnly * 100);

    var currentTick = tickOnly.toString().padStart(3, '0');
    if (DMTTTickLocal.innerHTML !== currentTick) {
        DMTTTickLocal.innerHTML = currentTick;
    }

    var currentCentiTick = centiTickOnly.toString().padStart(2, '0');
    if (DMTTCentiTickLocal.innerHTML !== currentCentiTick) {
        DMTTCentiTickLocal.innerHTML = currentCentiTick;
    }
}

updateDMTTLocal();
setInterval(updateDMTTLocal, 864 / 8);
// A tick takes 864ms, but because of lag that differs between browsers the deviation from the current time can make the browser catch up with skipping ticks.
// To make this less obvious we refresh 8 times as much, so a skip is 8 times as common but only an 8th of the amount and less noticeable. </script>

DMTT Earth

The above is the local time though. I proposed to have one global time, so conversions are not necessary anymore. The local time has the advantage that you can also do simple calculations like: It’s now 750t, so 75% of the day has passed, but it doesn’t travel well. If instead we use Greenwich time as the zero point for our earth time, the current time is:

function updateDMTT() {
    var now           = new Date();
    var milliSeconds  = (now.getUTCSeconds() + (now.getUTCMinutes() * 60) + (now.getUTCHours() * 60 * 60)) * 1000 + now.getUTCMilliseconds();
    var centiTick     = Math.floor(milliSeconds / 864);
    var tickOnly      = Math.floor(centiTick / 100);
    var centiTickOnly = centiTick - (tickOnly * 100);

    var currentTick = tickOnly.toString().padStart(3, '0');
    if (DMTTTick.innerHTML !== currentTick) {
        DMTTTick.innerHTML = currentTick;
    }

    var currentCentiTick = centiTickOnly.toString().padStart(2, '0');
    if (DMTTCentiTick.innerHTML !== currentCentiTick) {
        DMTTCentiTick.innerHTML = currentCentiTick;
    }
}

updateDMTT();
setInterval(updateDMTT, 864 / 8);
// A tick takes 864ms, but because of lag that differs between browsers the deviation from the current time can make the browser catch up with skipping ticks.
// To make this less obvious we refresh 8 times as much, so a skip is 8 times as common but only an 8th of the amount and less noticeable. </script>

Where the time in the previous clock was different for each region, the above time is the same as other visitors of this page are seeing right now. That means that international train schedules and flight departures/arrivals are not in any local time anymore, but always in the same global unit. It also means that if you want to plan an international meeting or chat you don’t have to have the confusion of calling a number of hours too early for example.

This also means that what time of the day corresponds to what amount of ticks is different for each locality. In the netherlands, the sun will rise at 250 and set at 750 as an example.

licensed under CC0 1.0

Back to posts ↺