Nanoseconds to date

Convert 19-digit nanosecond timestamps without losing digits. The comparison panel shows what a naive JavaScript Number would have produced.

Nowreading device clock…
Unix number in any unit, ISO 8601, RFC 2822, Excel serial, FILETIME, UUID, ULID or Snowflake.
Unit
IANA zone; type to search, e.g. Kolkata, Paris.
Precision and rounding
  • Check: 19 digits exceed Number.MAX_SAFE_INTEGER (2^53 - 1). JavaScript Number, JSON.parse and many spreadsheets would silently change it to 1700000000123456768. This tool uses exact BigInt arithmetic.
Same digits in other units
Other formats this number could be (2)
UTCUTC+00:00
2023-11-14 Tue
22:13:20.123456789
UTCUTC+00:00
2023-11-14 Tue
22:13:20.123456789

Read as Unix nanoseconds (unit locked) high confidence

Precision check: exact vs JavaScript Number and Date
Exact (BigInt)
1 700 000 000 123 456 789 ns
Number(input)
1700000000123456768 (off by -21 ns)
new Date(ms)
drops 456789 ns below the millisecond
Unix epoch
Unix seconds1700000000.123456789Exact; fraction shown when present
Unix seconds (integer, floor) rounded1700000000Sub-second part dropped (floor)
Unix milliseconds1700000000123.456789
Unix microseconds1700000000123456.789
Unix nanoseconds1700000000123456789
Unix seconds (hex) rounded0x6553F100
Standard date formats
ISO 8601 (UTC)2023-11-14T22:13:20.123456789Z
RFC 3339 (UTC)2023-11-14T22:13:20.123456789+00:00
RFC 9557 (offset + zone)2023-11-14T22:13:20.123456789+00:00[UTC]
RFC 2822 (UTC) roundedTue, 14 Nov 2023 22:13:20 +0000Whole seconds only
HTTP-date (IMF-fixdate) roundedTue, 14 Nov 2023 22:13:20 GMTAlways GMT; whole seconds
SQL TIMESTAMP (UTC) rounded2023-11-14 22:13:20.123456Microsecond precision max (PostgreSQL/MySQL)
SQL TIMESTAMP (UTC wall time) rounded2023-11-14 22:13:20.123456No zone stored: ambiguous without context
PostgreSQL timestamptz literal rounded2023-11-14 22:13:20.123456+00:00
ISO week date (UTC)2023-W46-2
Ordinal date (UTC)2023-318
Readable (UTC)Tuesday, 14 November 2023, 22:13:20 UTCCanonical English; not locale-dependent
Platform and system epochs
JavaScript new Date(ms) roundednew Date(1700000000123)Date keeps milliseconds only: loses 456789 ns
Java InstantInstant.ofEpochSecond(1700000000L, 123456789L)Nanosecond precision
Python datetime (UTC) roundeddatetime(2023, 11, 14, 22, 13, 20, 123456, tzinfo=timezone.utc)datetime keeps microseconds; nanoseconds dropped
.NET DateTime ticks rounded638355968001234567100-ns ticks since 0001-01-01 (DateTime.Ticks with Kind=Utc).
Windows FILETIME / LDAP rounded133444736001234567100-ns intervals since 1601 UTC. Active Directory lastLogon, pwdLastSet, accountExpires.
Chrome / WebKit time rounded13344473600123456Microseconds since 1601 UTC (Chrome history, cookies).
Apple Cocoa / Core Data rounded721692800.123456NSDate timeIntervalSinceReferenceDate, Core Data, iOS/macOS plists.
Mac HFS+ seconds rounded3782844800Classic Mac OS / HFS+ volume dates (seconds since 1904).
NTP seconds (era 0) rounded3908988800.123456NTP era 0 wraps on 2036-02-07; era numbers are not encoded in the 32-bit field.
Excel serial 1900 (UTC wall time) rounded45244.9259273548Days since 1900-01-00 with the Lotus 1-2-3 leap-year bug (serial 60 = fictitious 1900-02-29). No time zone.
Excel serial 1904 (UTC wall time) rounded43782.9259273548Older Mac Excel workbooks. Days since 1904-01-01. No time zone.
Julian Date rounded2460263.4259273548Days since noon UT, 24 Nov 4714 BC. Computed from UTC, so it ignores the UT1/TT distinction.
Modified Julian Date rounded60262.9259273548JD - 2400000.5. Computed from UTC.
GPS seconds1384035218.123456789Seconds since the GPS epoch, counting leap seconds (GPS = TAI - 19 s). Uses the bundled leap-second table.
TAI (TAI-UTC = 37 s)2023-11-14T22:13:57.123456789 TAIFrom the bundled leap-second table
ID range bounds
Smallest UUIDv7 at this ms018bcfe5-687b-7000-8000-000000000000Use as a range-query lower bound
Smallest ULID at this ms01HF7YAT3V0000000000000000
Smallest Twitter / X Snowflake1724551110972145664
Smallest Discord Snowflake1174109841514299392
Smallest MongoDB ObjectId6553f1000000000000000000
Settings and local data

Storage: checking…

Why nanoseconds break most converters

JavaScript numbers are 64-bit floats with 53 bits of integer precision. Every integer above 9,007,199,254,740,991 is rounded, so Number("1700000000123456789") becomes 1700000000123456800 and the last digits are gone. JSON parsers, spreadsheets and many online converters take that path without warning.

This page keeps the input as text and converts it with BigInt. The precision panel compares the exact value with the Number reading and with what a JavaScript Date can hold (whole milliseconds). Then you can see exactly how many nanoseconds each step would lose.

Examples to try

Signed 64-bit limits

Go time.UnixNano(), pandas Timestamp and Arrow timestamp[ns] store nanoseconds in a signed 64-bit integer. That only covers 1677-09-21 to 2262-04-11. Values outside that window convert fine here, and the converter adds a note that those runtimes cannot represent them.

Questions

Can JavaScript Date store nanoseconds?
No. Date stores whole milliseconds, so the last six digits of a nanosecond timestamp are dropped. Use BigInt, or Temporal.Instant in runtimes that support it.
How do I convert nanoseconds to seconds?
Divide by 1,000,000,000. The converter shows the exact decimal (1700000000.123456789) and the floored integer seconds.
What is the 2262 problem?
Signed 64-bit nanoseconds overflow at 2262-04-11T23:47:16.854775807Z. Systems that use int64 nanoseconds (Go, pandas, Arrow) cannot represent later instants.