Milliseconds to date

Convert epoch milliseconds, the format of JavaScript Date.now() and Java currentTimeMillis(), into UTC and local dates. Millisecond precision is kept in every output.

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
Same digits in other units
UTCUTC+00:00
2023-11-14 Tue
22:13:20.000
UTCUTC+00:00
2023-11-14 Tue
22:13:20.000

Read as Unix milliseconds (unit locked) high confidence

Precision check: exact vs JavaScript Number and Date
Exact (BigInt)
1 700 000 000 000 000 000 ns
Number(input)
1700000000000 (no loss)
new Date(ms)
no loss
Unix epoch
Unix seconds1700000000Exact; fraction shown when present
Unix seconds (integer, floor)1700000000
Unix milliseconds1700000000000
Unix microseconds1700000000000000
Unix nanoseconds1700000000000000000
Unix seconds (hex)0x6553F100
Standard date formats
ISO 8601 (UTC)2023-11-14T22:13:20.000Z
RFC 3339 (UTC)2023-11-14T22:13:20.000+00:00
RFC 9557 (offset + zone)2023-11-14T22:13:20.000+00:00[UTC]
RFC 2822 (UTC)Tue, 14 Nov 2023 22:13:20 +0000
HTTP-date (IMF-fixdate)Tue, 14 Nov 2023 22:13:20 GMTAlways GMT; whole seconds
SQL TIMESTAMP (UTC)2023-11-14 22:13:20.000Microsecond precision max (PostgreSQL/MySQL)
SQL TIMESTAMP (UTC wall time)2023-11-14 22:13:20.000No zone stored: ambiguous without context
PostgreSQL timestamptz literal2023-11-14 22:13:20.000+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)new Date(1700000000000)
Java InstantInstant.ofEpochSecond(1700000000L, 0L)Nanosecond precision
Python datetime (UTC)datetime(2023, 11, 14, 22, 13, 20, 0, tzinfo=timezone.utc)Microsecond precision
.NET DateTime ticks638355968000000000100-ns ticks since 0001-01-01 (DateTime.Ticks with Kind=Utc).
Windows FILETIME / LDAP133444736000000000100-ns intervals since 1601 UTC. Active Directory lastLogon, pwdLastSet, accountExpires.
Chrome / WebKit time13344473600000000Microseconds since 1601 UTC (Chrome history, cookies).
Apple Cocoa / Core Data721692800NSDate timeIntervalSinceReferenceDate, Core Data, iOS/macOS plists.
Mac HFS+ seconds3782844800Classic Mac OS / HFS+ volume dates (seconds since 1904).
NTP seconds (era 0)3908988800NTP era 0 wraps on 2036-02-07; era numbers are not encoded in the 32-bit field.
Excel serial 1900 (UTC wall time) rounded45244.9259259259Days 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.9259259259Older Mac Excel workbooks. Days since 1904-01-01. No time zone.
Julian Date rounded2460263.4259259259Days since noon UT, 24 Nov 4714 BC. Computed from UTC, so it ignores the UT1/TT distinction.
Modified Julian Date rounded60262.9259259259JD - 2400000.5. Computed from UTC.
GPS seconds1384035218Seconds 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.000 TAIFrom the bundled leap-second table
ID range bounds
Smallest UUIDv7 at this ms018bcfe5-6800-7000-8000-000000000000Use as a range-query lower bound
Smallest ULID at this ms01HF7YAT000000000000000000
Smallest Twitter / X Snowflake1724551110456246272
Smallest Discord Snowflake1174109840998400000
Smallest MongoDB ObjectId6553f1000000000000000000
Settings and local data

Storage: checking…

Milliseconds in practice

A 13-digit epoch is almost always milliseconds: Kafka record timestamps, Elasticsearch date fields, MongoDB $date, Java Instant.toEpochMilli() and every browser Date. With the unit locked to milliseconds, the ISO output keeps three fractional digits even when they are zeros. That makes it clear the value is millisecond-precise rather than truncated to the second.

If you are moving a value into a system that uses seconds, copy the "Unix seconds" row. It is the exact quotient, so 1700000000123 ms becomes 1700000000.123. Copy "Unix seconds (integer, floor)" when the target only takes whole seconds.

Examples to try

Common millisecond mistakes

Passing milliseconds to Python datetime.fromtimestamp() raises "year out of range" because it expects seconds. Passing seconds to JavaScript new Date() gives a date in January 1970. Storing milliseconds in a 32-bit integer overflows after 24.8 days of uptime. When you lock the unit here and the result is not a plausible date, a warning shows what the value would be in each other unit.

Questions

How do I convert milliseconds to seconds?
Divide by 1000. The converter shows both the exact decimal (1700000000.123) and the floored integer (1700000000), so you can pick the right one for the target system.
What is the largest millisecond timestamp JavaScript supports?
8,640,000,000,000,000 ms, which is +275760-09-13T00:00:00Z. Beyond that, new Date() returns Invalid Date. This tool still converts those values exactly in UTC.
Why does a millisecond value show .000 in the ISO output?
The output keeps the precision of the input. A millisecond timestamp is precise to the millisecond, so three fractional digits are shown. Use the precision menu to change this.