A CLI tool and Python library for Swatch® Internet Time (.beats).
Swatch® Internet Time divides the day into 1000 beats (@000 to @999), with each beat equal to 1 minute and 26.4 seconds. It uses BMT (Biel Mean Time, UTC+1) as its reference timezone, eliminating the need for time zones or daylight saving conversions.
pip install beat-time| Flag | Description |
|---|---|
-c, --centibeats |
Display centibeats (fractional beats) |
-t, --time |
Time to convert in HH:MM:SS format |
-z, --timezone |
Timezone offset in hours (default: 1) |
-v, --version |
Show version |
Get the current time in beats:
$ beat
@123With centibeats for more precision:
$ beat -c
@123.456Convert a specific time (HH:MM:SS) to beats:
$ beat -t
@123Specify a timezone offset (default is UTC+1/BMT):
$ beat -t 1:57:46 -z 0
@123Show version:
$ beat -vimport beat_time
# Current time in beats
beat_time.now() # '@123'
beat_time.now(centibeats=True) # '@123.449'
# Convert a specific time (hours, minutes, seconds, timezone offset)
beat_time.internettime(1, 57, 46, tzone=0) # '@123'
beat_time.internettime(1, 57, 46, tzone=0, centibeats=True) # '@123.449'A standalone HTML version is available in docs/index.html that displays the current beat time in the browser, updating every centibeat (864ms).