Proposals

Extensions and enhancements in development for BEVE

About BEVE Extensions

BEVE supports extensions to handle specialized use cases while maintaining compatibility with the core specification. These proposals are working drafts that may be incorporated into future versions of BEVE.

Extension 4 — Time (Timestamps)

Working draft for BEVE v1.0

Status: Working Draft

Extension ID: 4

Overview

A compact, SIMD-friendly encoding for instants in time that:

Goals

Placement in BEVE Header Space

This is a BEVE Extension (HEADER top 3 bits = 6).

Within the extension space, id = 4 denotes Time (timestamps).

Existing ids: 0=data delimiter, 1=type tag, 2=matrices, 3=complex numbers.
New: 4=time

All multi-byte integers in this extension are little endian.

TIME HEADER (1 byte)

bits 0..1  SHAPE
           0 = single timestamp
           1 = timestamp array (exactly length 2)
           2..3 = reserved

bits 2..4  UNIT (decimal powers around seconds)
           0 = ksec (10^3 s)
           1 = s
           2 = ms   (10^-3 s)
           3 = µs   (10^-6 s)
           4 = ns   (10^-9 s)
           5 = ps   (10^-12 s)
           6 = fs   (10^-15 s)
           7 = as   (10^-18 s)

bit 5      TZ_PRESENT
           0 = no TZ field follows
           1 = int16_t minutes east of UTC follows (fixed 2 bytes)

bits 6..7  EPOCH/SCALE
           0 = UNIX/POSIX (no leap seconds)
           1 = UTC scale  (permits leap seconds)
           2 = TAI
           3 = GPS

Timezone field (optional; fixed width)

If TZ_PRESENT=1, immediately write a 2-byte int16_t: minutes east of UTC.

Payload Layouts

Single timestamp

EXT(4) | TIME_HEADER | [TZ:int16]? |
NUMBER (signed)   SECONDS_OFFSET |
NUMBER (unsigned) PRECISION

Timestamp array

EXT(4) | TIME_HEADER | [TZ:int16]? |
ARRAY(len=2) |
TYPED_ARRAY (signed int)   SECONDS_OFFSET[] |
TYPED_ARRAY (unsigned int) PRECISION[]

JSON/Text Projections

Human-oriented (default): RFC 3339 strings

Lossless structured object

Single:

{
  "epoch": "unix",                 // "unix" | "utc" | "tai" | "gps"
  "unit": "ps",                    // "ksec","s","ms","us","ns","ps","fs","as"
  "seconds": 1750000000,           // signed integer
  "precision": 123456789012,       // unsigned integer
  "offset_minutes": -300           // optional; omitted if TZ not present
}

Array:

{
  "epoch": "unix",
  "unit": "ns",
  "offset_minutes": 0,
  "seconds":   [1697463296, 1697466896],
  "precision": [        42,  987654321]
}

Examples

Single, UNIX epoch, nanoseconds, UTC

Meaning: 2025-10-16T12:34:56.000000789Z

EXT(4) | TH(shape=single, unit=ns, tz=0, epoch=unix) |
NUMBER(int64) seconds=1697463296 |
NUMBER(uint32) precision=789

Array, UNIX epoch, microseconds, TZ = −05:00

Meaning: local offset preserved for printing; instants absolute.

EXT(4) | TH(shape=array, unit=us, tz=1, epoch=unix) | int16(-300) |
TYPED_ARRAY(int64)   seconds[ N ] |
TYPED_ARRAY(uint32)  precision[ N ]

ksec example

Key Features

Integer-Only Math

No floating point drift, exact representations

Attosecond Precision

Scales to 10^-18 seconds without bigints for current dates

SIMD-Friendly Arrays

Metadata shared across arrays for high throughput

Multiple Epochs

Support for UNIX, UTC, TAI, and GPS time scales

Timezone Preservation

Optional timezone field for presentation without affecting instant

RFC 3339 Compatible

Clean round-trip to ISO-8601 and IXDTF formats

Full Specification: For the complete technical specification, validation rules, and reference algorithms, see the full proposal on GitHub.

Contributing to Proposals

We welcome feedback and contributions to BEVE proposals. To participate: