Expand description
ExactBrightDate — bit-exact picosecond-precision time.
Whereas BrightDate uses f64 decimal days for
ergonomic math and astronomy, ExactBrightDate uses a signed i128
count of picoseconds since J2000.0 to provide bit-for-bit
round-trip fidelity with Unix milliseconds, Unix seconds, and other
integer-based representations.
§When to use which
| Use case | Choose |
|---|---|
| Application timestamps, logs, scheduling, display | BrightDate |
| Astronomy, physics, fractional math | BrightDate |
| Distributed systems, GPS, interplanetary timing | BrightInstant |
| Blockchain consensus on raw Unix-ms values | ExactBrightDate |
| Long-term archival that must survive bit-for-bit | ExactBrightDate |
| Sub-picosecond precision at any magnitude | ExactBrightDate |
§Precision
- Internal unit: picoseconds (
1e-12s). - Range:
i128covers±~1.7e38 ps ≈ ±5.4e18 years. Comfortably beyond the age of the universe in either direction. - Resolution: 1 picosecond, exactly, everywhere.
§Algebraic laws
For any integer unix_ms in i64:
ExactBrightDate::from_unix_ms(unix_ms).to_unix_ms() == unix_ms (bit-exact)For any a: ExactBrightDate and n: i128 nanoseconds:
a.add_nanoseconds(n).subtract_nanoseconds(n) == a (bit-exact)ExactBrightDate is immutable. All operations return new instances.
Structs§
- Exact
Bright Date - An immutable, bit-exact time value stored as picoseconds since J2000.0.
Constants§
- J2000_
UNIX_ MS_ I64 - J2000.0 expressed as Unix milliseconds — the exact i64 form of
crate::constants::J2000_UTC_UNIX_MS. - J2000_
UNIX_ PS - J2000.0 expressed as Unix picoseconds (UTC label).
- PS_
PER_ DAY - Picoseconds per SI day (86 400 s).
- PS_
PER_ MS - Picoseconds per millisecond.
- PS_
PER_ NS - Picoseconds per nanosecond.
- PS_
PER_ S - Picoseconds per SI second.
- PS_
PER_ US - Picoseconds per microsecond.