Swatch® Internet Time conversion (beats)
Project description
beat
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.
Installation
pip install beat-time
CLI Options
| 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 |
CLI Usage
Get the current time in beats:
$ beat
@123
With centibeats for more precision:
$ beat -c
@123.456
Convert a specific time (HH:MM:SS) to beats:
$ beat -t
@123
Specify a timezone offset (default is UTC+1/BMT):
$ beat -t 1:57:46 -z 0
@123
Show version:
$ beat -v
Library Usage
import 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'
Web Version
A standalone HTML version is available in docs/index.html that displays the current beat time in the browser, updating every centibeat (864ms).
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beat_time-1.0.0.tar.gz.
File metadata
- Download URL: beat_time-1.0.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e806e65a01e4d795bbe3e49a10e9abb002730f55d4b8a09ded285092971e84a
|
|
| MD5 |
594f10d429f1c4eb4b691c211943f223
|
|
| BLAKE2b-256 |
999b515c4d07019c417d23f9722ab7b895aeb7d369e1a7ec5d64f48c4b64599d
|
File details
Details for the file beat_time-1.0.0-py3-none-any.whl.
File metadata
- Download URL: beat_time-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
757a45447c6d77a95bb145926b21cf2c60f88747b23ccb7ae8fe9a993d0f330c
|
|
| MD5 |
af6ae09d8fda56fb3cf0339c8ac2e21d
|
|
| BLAKE2b-256 |
d56494f162a5b2dcd4db39989bafdf0b4584c91d4a5e21109c00c50747fb7eca
|