Nanoseconds to date converter
Converts a nineteen-digit nanosecond timestamp into a date. Go’s `time.UnixNano()`, Prometheus and most tracing systems work in nanoseconds.
How to use the nanoseconds to date converter
Nanosecond precision runs into a hard limit that catches people out: a signed 64-bit integer of nanoseconds only spans about 584 years, so Go’s `UnixNano` is documented as undefined outside 1678 to 2262. That is fine for observability data and wrong for anything historical. The other practical point is that JavaScript cannot represent these numbers exactly — a nineteen-digit integer exceeds the 53-bit safe integer range, so parsing one into a `Number` loses the last few digits. Anything comparing nanosecond timestamps for ordering needs BigInt or strings, not floats.
Questions
Go’s time package, Prometheus, OpenTelemetry and most distributed tracing.