22 years of .beat time
Time is 8030000 .beats
Twenty-two years ago the concept of .beat time (aka Swatch Internet Time) was introduced. The novelty was to replace hours and minutes by a decimal number called ".beats", which is the length of the mean solar day divided into 1000 parts.
A time system for the Internet generation! Unfortunately it never gained wide acceptance in peoples daily life.
To celebrate the passing of more than 8 million beats, here is my .beat time implementation in Python:
from datetime import timedelta, datetime
def beattime():
"""Returns a float with the current beat time (a.k.a. Swatch Internet Time).
A mean solar day is diveded into 1000 so-called .beats, which implies
that a .beat is 86.400002 seconds ~1 minute 26.4 sec.
A .beat should be shown with a preceding @ sign and without any decimals,
e.g. @240 .beats. But you may choose to include "centibeats" or
"sub-beats", e.g. @240.02 .beats, to get a more "clock-like" experience.
"""
utc_now = datetime.utcnow()
delta = timedelta(hours=utc_now.hour + 1 if utc_now.hour < 23 else 0,
minutes=utc_now.minute,
seconds=utc_now.second,
microseconds=utc_now.microsecond)
beats = (delta.seconds + delta.microseconds / 1000000.0) / 86.400002
return beats
if __name__ == '__main__':
from time import sleep
while True:
beats = beattime()
print("Beat time is @{:.0f} .beats, and with sub-beats: @{:.2f} .beats"
.format(beats, beats))
sleep(.86400002)
And here is my implementation in Javascript:
function beattime() {
var d = new Date();
var h = d.getUTCHours() < 23 ? d.getUTCHours() + 1 : 0;
var m = d.getUTCMinutes();
var s = d.getUTCSeconds();
var ms = d.getUTCMilliseconds();
return ((h * 60.0 + m) * 60.0 + s + ms / 1000.0) / 86.400002;
}