Profpatsch/users/Profpatsch/sfttime
- default.nix 213 B
- go.mod 35 B
- index.html 8.8 KiB
- sfttime.7 3.4 KiB
- sfttime.go 6.8 KiB
- sfttime.sh 3.4 KiB
sfttime(7)
NAME
sfttime - a hexadecimal time system based on fractional days
DESCRIPTION
sfttime is an alternative representation of UTC time. For example, 2026-04-23 at 13:37 UTC (the start of sft day 5056) is written:
5056.000[sft]
Time is expressed as a hexadecimal count of days since the
sfttime
epoch, with a fractional component for sub-day precision.
It is very regular, and timestamps are concise: a full timestamp with
second-level precision fits in 12 characters.
It is also a good fit for shell prompts and status lines, where only
the sub-day part is needed — that requires only five characters, for
example the start of the
sfttime
day (13:37 UTC) is
.0000,
and noon UTC is
.EEC0.
FORMAT
A full sfttime timestamp looks like:
DDDD.FFF[sft]
Where:
DDDD
Hexadecimal count of days since the sfttime epoch. Grows by 1 each day.
.FFF
Fractional part of the current day in hexadecimal. Three digits give a resolution of
1/4096of a day, approximately 21 seconds (one vergil). Four digits give a resolution of1/65536of a day, approximately 1.3 seconds (one tick).
[sft]
Optional suffix indicating the value is in sfttime. May be omitted in contexts where it is unambiguous.
The sub-day compact form omits the date entirely and is written as:
.F3C9
This is useful for timestamps where the date is known from context, such as log entries or status lines within a running session. Adding a fifth digit gives ~82ms precision (roughly 1/10 of a second), and a sixth digit gives millisecond-level precision (~5ms):
.F3C9A4
EPOCH
The
sfttime
epoch is
1970-01-01 13:37:00 UTC,
which is
49020
seconds after the Unix epoch (1970-01-01 00:00:00 UTC).
The choice of 13:37 is intentional.
UNITS
Each power of 16 in the fractional part has a name:
**Unit** **Duration** **Example** **Name**
`[sft]0` 1 day `1.0000[sft]` day
`[sft]-1` 1.5 hours `.1000[sft]` major (one university lecture)
`[sft]-2` ~5.6 minutes `.0100[sft]` schinken
`[sft]-3` ~21 seconds `.0010[sft]` vergil
`[sft]-4` ~1.3 seconds `.0001[sft]` tick
EXAMPLES
Converting the current time:
$ sfttime
5055.F3C[sft]
A compact sub-day timestamp as used in status lines:
These timestamps represent the same moment expressed at different precisions:
**Timestamp** **Precision**
`5055[sft]` day (24h)
`5055.F[sft]` major (1.5h)
`5055.F3[sft]` schinken (~5.6min)
`5055.F3C[sft]` vergil (~21s)
`5055.F3C9[sft]` tick (~1.3s)
CONVERSION
To convert a sfttime timestamp to Unix time:
unix = hex_to_decimal(sfttime) * 86400 + 49020
To convert Unix time to sfttime:
sfttime = decimal_to_hex((unix - 49020) / 86400)
TIDBITS
The name 'sft' is the clan name of a group of friends from Munich, Bavaria.
SEE ALSO
date(1)
Coordinated Universal Time (UTC)
https://en.wikipedia.org/wiki/Coordinated_Universal_Time
dot-time — a universal convention for conveying time
https://dotti.me/
HISTORY
sfttime
was created in
3BBE.81[sft]
(approximately 2013).