EpochLab

Nanoseconds Converter

Convert nanoseconds to a date, and back

The 19-digit form, used by Go's `UnixNano`, Prometheus, InfluxDB and OpenTelemetry. You also get a warning about the digits JavaScript can drop on the way.

Questions people ask

The things that come up about nanoseconds converters, answered plainly.

Why does my nanosecond value lose its last digits?

JavaScript stores each number as a 64-bit float. That holds whole numbers exactly up to 53 bits. A nanosecond timestamp needs about 61. So anything finer than about a microsecond gets rounded. If the last three digits matter, use BigInt or a string.

When does nanosecond time overflow?

A signed 64-bit count of nanoseconds runs out in 2262. That is why Go's `time.Time` keeps seconds and nanoseconds apart, not as one big number.

Related tools

Seconds, milliseconds, microseconds and nanoseconds, in both directions.