/orbeat-time

Orbeat Time

Primary LanguageHTMLGNU General Public License v3.0GPL-3.0

Orbeat Time

Summary

Orbeat is an octal time system. It gets its name from a combination of octal, orbit, and beat. This naming reflects the system's structure, which utilizes an octal (base-8) representation to measure time in a continuous, orbit-like cycle.

Background

Loosely inspired by Swatch Internet Time (.beat time), a decimal time system introduced in 1998 used on ICQ and in the game Phantasy Star Online to facilitate cross-continent gaming. It also draws inspiration from batch codes used in retail and manufacturing industries for date codes and competitive intelligence.

Motivation

I created this project out of intellectual curiosity and as a practical tool. It was a stimulating exercise that allowed me to combine various concepts across multiple disciplines. I needed an efficient and cryptic timestamping method, like batch codes, to manage public-facing personal documents. I sought to devise an innovative way to balance precision with obscurity by crafting a compact yet noteworthy date time code, which would be meaningful to me while remaining ambiguous for others.

Design Decisions

My design decisions include:

  • Using little-endian ordering, which is more common in modern computing systems
  • Adopting a base-8 (octal) number system to avoid rounding issues common in decimal systems
  • Flooring the total days before calculating years to ensure accurate year representation
  • Full-year was omitted in favor of brevity and due to space constraints
  • Including a single fractional year digit to provide a month-like division of the year
  • Avoiding timezones to simplify global time representation
  • Using the Unix epoch for convenience and to avoid leap-second complications
  • The precision is ~21 seconds roughly in the scale of seconds
  • Used 365.24219 days per year, which is the mean tropical year, to minimize long-term drift

Format

A concatenated string consisting of:

  • Days since Unix epoch formatted with specific digit counts and then reversed
  • Years since Unix epoch formatted with specific digit counts and then reversed

Implementation

The encoding process involves the following steps:

  1. Calculate the Unix timestamp in milliseconds
  2. Convert the milliseconds to fractional days since the Unix epoch
  3. Floor the total days and then convert the milliseconds to fractional years since the Unix epoch
  4. Transform both days to octal format, preserving the fractional parts
  5. Transform both years to octal format, preserving the fractional parts
  6. Format each part (days and years) with specific digit counts for whole and fractional parts
  7. Combine the formatted years and days
  8. Reverse the concatenated string to generate the Orbeat time

Example

The encoding process:

  • Input:
    • Unix timestamp in milliseconds (e.g., 1700000000000)
  • Conversion:
    • Days: 1700000000000 / 8640000019675.9259259 days
    • Years: Math.floor(19675.9259259) / 365.2421953.86836608333775 years
  • Octal Formatting:
    • Days: 19675.9259259 → octal ≈ 46333.7320457
    • Years: 53.86836608333775 → octal ≈ 65.674464752616
  • Formatting with Digit Counts:
    • Days: 46333.732045733 (whole) + 7320 (fraction) → 337320
    • Years: 65.6744647526165 (whole) + 6 (fraction) → 56
  • Concatenation and Reversal:
    • Combined: Years + Days → 56337320
    • Reversed: 02373365
  • Output: 02373365