Unix epoch converter
Turn a Unix timestamp into a date, or a date into a timestamp, in seconds, milliseconds, microseconds or nanoseconds. When the unit is guessed, the page shows the guess and how each other unit would have read the same digits. Nothing you type leaves your browser.
The tool
Epoch number to date
Date to epoch number
How to use
- Paste the number into Unix timestamp. Digits, an optional minus sign and one decimal point are accepted; underscores are ignored. Hexadecimal and scientific notation such as
1.7e9are refused rather than rounded, because a rounded timestamp is a wrong timestamp. - Leave Unit on Auto, or choose the unit you know. With Auto the rule is: a whole-number part below 1e11 is seconds, below 1e14 milliseconds, below 1e17 microseconds, and above that nanoseconds. The status line says which was chosen, and the table "How each unit would read these same digits" shows all four readings.
- Choose the zone for the local time. The filter box narrows the list of zone names the browser knows. The UTC result does not depend on this choice.
- Read the result: the big line is UTC in ISO 8601 / RFC 3339 form. Below it are the local time with its offset, the RFC 5322 and HTTP-date spellings, the weekday, day of year and ISO week, and the same instant in all four units as exact integers.
- To go the other way, type a date and time in Date to epoch number (
YYYY-MM-DD hh:mm:ss, with an optional fraction) and say whether those clock fields are UTC or in the zone chosen above. If the zone has a clock change at that moment, the page tells you the reading never happens or happens twice and shows what it did.
All arithmetic uses exact integers (BigInt), so a nanosecond timestamp keeps all of its digits. A JavaScript Number cannot: it holds integers exactly only up to 253 - 1, about 9.0e15, and a nanosecond timestamp for 1 October 2026 (1790812800000000000, which is 2026-10-01T00:00:00Z) is about 1.79e18, nearly 200 times too big for that.
Worked examples
Every result printed here is recomputed by an automated test from the same engine as the tool, and the key ones are also checked against JavaScript's own Date in the tests.
One instant in four units
1700000000 seconds after 1970-01-01T00:00:00Z is 22:13:20 UTC on 14 November 2023. The same instant is 1700000000000 milliseconds, and it keeps whatever finer digits you give it.
Unit: Auto
Input: 1700000000
Output: 2023-11-14T22:13:20Z (seconds, auto-detected)
Unit: Auto
Input: 1700000000000
Output: 2023-11-14T22:13:20Z (milliseconds, auto-detected)
Unit: Auto
Input: 1700000000123
Output: 2023-11-14T22:13:20.123Z (milliseconds, auto-detected)
Unit: Auto
Input: 1700000000123456789
Output: 2023-11-14T22:13:20.123456789Z (nanoseconds, auto-detected)
Unit: Auto
Input: 1700000000.5
Output: 2023-11-14T22:13:20.500Z (seconds, auto-detected)
The edges: zero, minus one, the largest 32-bit value
Unit: Auto
Input: 0
Output: 1970-01-01T00:00:00Z (seconds, auto-detected)
Unit: Auto
Input: -1
Output: 1969-12-31T23:59:59Z (seconds, auto-detected)
Unit: Auto
Input: 2147483647
Output: 2038-01-19T03:14:07Z (seconds, auto-detected)
2147483647 is 231 - 1, the largest signed 32-bit integer; the year 2038 page shows what happens one second later.
Local time in other zones
Jakarta is UTC+7 all year, so 22:13:20 UTC is 05:13:20 the next morning. Kathmandu is UTC+5:45, so the minutes change too.
Zone: Asia/Jakarta
Input: 1700000000
Output: 2023-11-14T22:13:20Z (seconds, auto-detected); Asia/Jakarta: 2023-11-15T05:13:20+07:00
Zone: Asia/Kathmandu
Input: 1700000000
Output: 2023-11-14T22:13:20Z (seconds, auto-detected); Asia/Kathmandu: 2023-11-15T03:58:20+05:45
Either side of a clock change
New York sprang forward at 07:00:00 UTC on 8 March 2026. One second before that instant local time was 01:59:59 at -05:00; at that instant it is 03:00:00 at -04:00. The hour from 02:00 to 02:59 never appears on a New York clock.
Unit: s; zone: America/New_York
Input: 1772953199
Output: 2026-03-08T06:59:59Z (seconds); America/New_York: 2026-03-08T01:59:59-05:00
Unit: s; zone: America/New_York
Input: 1772953200
Output: 2026-03-08T07:00:00Z (seconds); America/New_York: 2026-03-08T03:00:00-04:00
Date to number
Clock fields are in: UTC
Input: 2023-11-14 22:13:20
Output: 1700000000
Clock fields are in: America/New_York
Input: 2023-11-14 22:13:20
Output: 1700018000
The same clock reading is 18000 seconds (5 hours) later in New York, because New York was at UTC-5 on that date. One second before the epoch, and the last second of year 9999:
Clock fields are in: UTC
Input: 1969-12-31 23:59:59
Output: -1
Clock fields are in: UTC
Input: 9999-12-31 23:59:59
Output: 253402300799
The same task in code
These are the shortest correct versions in each language. The ones marked as executed were run while this page was written and print exactly what is shown; the others were not run (see the notes under each).
Epoch seconds to a UTC date-time (1700000000)
JavaScript (Node.js)
console.log(new Date(1700000000 * 1000).toISOString()); Output when run: 2023-11-14T22:13:20.000Z Date counts milliseconds, so seconds are multiplied by 1000.
Python 3 (zoneinfo)
from datetime import datetime, timezone
print(datetime.fromtimestamp(1700000000, tz=timezone.utc).isoformat()) Output when run: 2023-11-14T22:13:20+00:00
Go
fmt.Println(time.Unix(1700000000, 0).UTC().Format(time.RFC3339)) Output when run: 2023-11-14T22:13:20Z
SQLite
SELECT datetime(1700000000, 'unixepoch'); Output when run: 2023-11-14 22:13:20
Java (not executed here)
System.out.println(java.time.Instant.ofEpochSecond(1700000000L)); Not executed here: the machine that built this site has no Java; the line is shown for orientation only.
PostgreSQL (not executed here)
SELECT to_timestamp(1700000000) AT TIME ZONE 'UTC'; Not executed here: PostgreSQL is not installed on the machine that built this site.
MySQL (not executed here)
SELECT FROM_UNIXTIME(1700000000); Not executed here: MySQL is not installed on the machine that built this site. The MySQL manual says FROM_UNIXTIME() returns values in the current session time zone, so the text you get depends on the session’s time_zone setting.
A UTC date-time to epoch seconds (2023-11-14 22:13:20)
JavaScript (Node.js)
console.log(Date.UTC(2023, 10, 14, 22, 13, 20) / 1000); Output when run: 1700000000 The month argument is 0-based: 10 means November.
Python 3 (zoneinfo)
from datetime import datetime, timezone
print(int(datetime(2023, 11, 14, 22, 13, 20, tzinfo=timezone.utc).timestamp())) Output when run: 1700000000 Without tzinfo=timezone.utc, Python would read the fields in the machine’s local time zone.
Go
fmt.Println(time.Date(2023, 11, 14, 22, 13, 20, 0, time.UTC).Unix()) Output when run: 1700000000
SQLite
SELECT unixepoch('2023-11-14 22:13:20'); Output when run: 1700000000
MySQL (not executed here)
SELECT UNIX_TIMESTAMP('2023-11-14 22:13:20'); Not executed here: MySQL is not installed on the machine that built this site. The MySQL manual says UNIX_TIMESTAMP() assumes its argument is a datetime in the session time zone, so the result is 1700000000 only if the session time zone is UTC.
Java (not executed here)
System.out.println(java.time.LocalDateTime.of(2023, 11, 14, 22, 13, 20).toEpochSecond(java.time.ZoneOffset.UTC)); Not executed here: the machine that built this site has no Java; the line is shown for orientation only.
What goes wrong
Real inputs that surprise people. Each result is the tool's exact output and is covered by a test.
The unit guess can be wrong
A count of 253402300800 is 1 January 10000 if it is seconds. Auto-detect sees 12 digits, which is above its 1e11 limit for seconds, and reads milliseconds instead.
Unit: Auto
Input: 253402300800
Output: 1978-01-11T21:31:40.800Z (milliseconds, auto-detected)
Unit: s
Input: 253402300800
Output: +010000-01-01T00:00:00Z (seconds)
Numbers around 8 or 9 digits are plausible dates in more than one unit. 86400000 is 1000 days in seconds and exactly one day in milliseconds:
Unit: Auto
Input: 86400000
Output: 1972-09-27T00:00:00Z (seconds, auto-detected)
Unit: ms
Input: 86400000
Output: 1970-01-02T00:00:00Z (milliseconds)
The table under the result
Input: 86400000
Table under the result: s: 1972-09-27T00:00:00Z; ms: 1970-01-02T00:00:00Z; us: 1970-01-01T00:01:26.400000000Z; ns: 1970-01-01T00:00:00.086400000Z
A consequence of the thresholds: a millisecond timestamp for a date before 1973-03-03 has fewer than 12 digits and is read as seconds, and a seconds timestamp after 5138-11-16 has 12 digits and is read as milliseconds.
Unit: Auto
Input: 99999999999
Output: 5138-11-16T09:46:39Z (seconds, auto-detected)
Unit: Auto
Input: 100000000000
Output: 1973-03-03T09:46:40Z (milliseconds, auto-detected)
The wrong unit by a factor of 1000
Unit: s
Input: 1700000000000
Output: +055840-11-08T22:13:20Z (seconds)
Unit: ms
Input: 1700000000
Output: 1970-01-20T16:13:20Z (milliseconds)
If a date lands in 1970 or in the year 50000, a factor of 1000 is the first thing to check.
Refused inputs
Unit: Auto
Input: 1.7e9
Error: Scientific notation is not accepted.
Unit: Auto
Input: 0x65535500
Error: Hexadecimal is not accepted here.
Unit: Auto
Input: 1700000000.1234567891
Error: The number has more decimal places than seconds can carry to the nanosecond.
Big numbers and the end of the range
The largest signed 64-bit integer, read as nanoseconds, is in April 2262. Go's documentation says Time.UnixNano is undefined for dates before the year 1678 or after 2262 for exactly this reason; this page keeps all nine digits and has no such limit.
Unit: Auto
Input: 9223372036854775807
Output: 2262-04-11T23:47:16.854775807Z (nanoseconds, auto-detected)
Unit: s
Input: 8640000000000
Output: +275760-09-13T00:00:00Z (seconds)
Unit: s
Input: 8640000000001
Error: This instant is outside the supported range of +-100,000,000 days around 1970 (about year -271821 to +275760).
A clock reading that is not one instant
"Date to epoch" with a zone needs the clock reading to name exactly one instant. On 8 March 2026 New York skips from 01:59:59 to 03:00:00, and on 1 November 2026 the hour from 01:00 to 01:59 happens twice. The page says so instead of picking silently.
Clock fields are in: America/New_York
Input: 2026-03-08 02:30:00
Output: never happens; the offset from before the jump gives 1772955000
Clock fields are in: America/New_York
Input: 2026-11-01 01:30:00
Output: twice: 1793511000 and 1793514600
The time zone converter lets you choose what to do in each case.
The month number in code
In JavaScript's Date.UTC(2023, 10, 14, ...) the month is 0-based, so 10 means November (see the snippet above). Passing 11 for November gives December, a month off and no error.
Limits & gotchas
- Leap seconds are not counted. POSIX defines seconds since the Epoch with every day exactly 86400 seconds, so the number does not advance during a leap second. JavaScript and SQLite document the same. A time of day such as 23:59:60 therefore has no timestamp of its own; the ISO 8601 validator shows how it is mapped.
- The unit guess is a rule of this site. It is not a standard. It separates the units only by magnitude, so it cannot tell 1000 days in seconds from one day in milliseconds, and it reads dates before 1973-03-03 written in milliseconds as seconds.
- Before 1970 and far from it. POSIX leaves the relationship undefined for negative values. The tool follows JavaScript: the proleptic Gregorian calendar extended backwards and forwards, with years outside 0000-9999 written in the signed, six-digit expanded form (
+010000). Its limit is 100,000,000 days either side of 1970 (about the years -271821 to +275760). - RFC 5322 and HTTP-date have limits of their own. RFC 5322 needs a year of at least 1900 and 4 digits, and the HTTP-date form is always in GMT with a 4-digit year. Where a date cannot be written in that form, the page says "not available" instead of inventing a spelling.
- Local time depends on your browser's time zone data. It comes from the browser's copy of the IANA database, which can lag behind rule changes (see the FAQ). While testing this site we saw it directly: a Node release carrying 2024b data and the 2026c data on the build machine disagreed about Africa/Casablanca after 2026-09-20. The UTC column is not affected.
- Weekday, day of year and ISO week refer to the UTC date. The local date can differ near midnight.
FAQ
How does the converter know if my number is seconds, milliseconds, microseconds or nanoseconds?
It does not know; it guesses from the size of the whole-number part. Below 100 billion (1e11) it reads seconds, below 1e14 milliseconds, below 1e17 microseconds, and anything larger nanoseconds. This is a rule made up for this site, not a standard, and the page shows how every unit would read your digits so you can see the guess. SQLite's "auto" modifier also guesses by magnitude, with its own limits (for numbers outside its Julian-day range, it reads values from -210866760000 to 253402300799 as Unix seconds). Whenever you know the unit, choose it.
Do Unix timestamps include leap seconds?
No. POSIX defines "seconds since the Epoch" so that every day is exactly 86400 seconds, which means leap seconds are not counted; JavaScript's Date and SQLite behave the same way. The IANA leap-seconds list has 27 insertions between 1972 and the end of 2016, so the second named 2016-12-31T23:59:60Z has no number of its own: it shares the number of the following midnight, 2017-01-01T00:00:00Z.
Can a timestamp be negative, and what does it mean?
Yes: -1 is one second before 1970-01-01T00:00:00Z. This tool and JavaScript's Date count backwards the same way (the proleptic Gregorian calendar, 86400 seconds a day). Be aware that POSIX says that for negative values, or years before 1970, "the relationship is undefined", so another system is allowed to treat them differently. The tool accepts instants within 100,000,000 days of 1970, which is the range of a JavaScript Date.
Why does the local time differ from what my phone or server shows?
Local time is computed with the time zone database that your browser carries. If that copy is older than the latest rule changes, the local column can be wrong for dates after the change. The IANA release notes show how fast rules change: release 2026c (2026-07-08) records Morocco moving to a permanent +00 offset from 2026-09-20 and Alberta to a permanent -06, and release 2026e (2026-09-29) records Manitoba moving to a permanent -05 on 2026-10-31. The UTC column does not depend on any zone data.
Is anything I type sent to a server?
No. The conversion runs in your browser, with no network request. The only thing stored is your option choices (unit, time zone) in this browser's localStorage; the numbers and dates you type are never stored.
Sources
- The Open Group: POSIX.1-2024 Base Definitions, 4.19 Seconds Since the Epoch Used for: Seconds since the Epoch "approximates" the seconds elapsed since the Epoch; the formula that relates a UTC date to it for years from 1970 and non-negative values; "If the year is <1970 or the value is negative, the relationship is undefined"; "each and every day shall be accounted for by exactly 86400 seconds" (so leap seconds are not counted); the relationship to actual UTC is unspecified.
- Ecma International / TC39: ECMAScript Language Specification: Time Values and Time Range; Date.parse; time zone offset helper operations Used for: A time value is milliseconds since 1970-01-01T00:00:00Z with every day exactly 86,400,000 ms (leap seconds are ignored); the range is +-8.64e15 ms (+-100,000,000 days); for a local time that is skipped or repeated, the offset in use before the transition is applied; a skipped local time yields no instant in the time-zone-to-epoch operation.
- MDN Web Docs: Date Used for: The supported range (April 20, 271821 BC to September 13, 275760 AD, plus or minus 100,000,000 days); that Date ignores leap seconds; Number.MAX_SAFE_INTEGER is 9,007,199,254,740,991; the date-time string format (a simplification of ISO 8601, 24:00:00 allowed, expanded years of + or - followed by six digits, -000000 disallowed); and that setting a local time inside a DST transition follows the Temporal "compatible" disambiguation: if the local time corresponds to two instants the earlier one is chosen, and if it does not exist the result goes forward by the gap duration (with the New York 2024 example).
- SQLite: Date And Time Functions Used for: The unixepoch and auto modifiers; with auto, a number between 0.0 and 5373484.499999 is read as a Julian day number and, outside that, a number from -210866760000 to 253402300799 is read as a Unix timestamp; SQLite computes as if every day is exactly 86400 seconds, with no leap seconds.
- IANA: leap-seconds.list Used for: The 27 leap seconds inserted since 1972 (TAI minus UTC rose from 10 s to 37 s, last step at the end of 2016-12-31) and that the file carries an expiry time (2027-06-28), after which it must be re-read.
- IANA: News for the tz database Used for: Recent rule changes made on short notice: release 2026c (2026-07-08) lists Alberta moving to permanent -06 and Morocco to permanent +00 from 2026-09-20; release 2026e (2026-09-29) lists Manitoba moving to permanent -05 on 2026-10-31.
- IETF (RFC Editor): RFC 5322: Internet Message Format, section 3.3 Date and Time Specification Used for: The date-time layout "Thu, 01 Oct 2026 00:00:00 +0000" with an optional day of week, and that a year is at least four digits and must be 1900 or later.
- IETF (RFC Editor): RFC 9110: HTTP Semantics, section 5.6.7 Date/Time Formats Used for: The preferred HTTP-date form, IMF-fixdate ("Sun, 06 Nov 1994 08:49:37 GMT"), which is always in GMT.
- The Go Authors: Go package time: Date Used for: Time.UnixNano is undefined for dates before the year 1678 or after 2262 (it must fit an int64). time.Date: in a transition that skips or repeats times (the doc's example is the US, 2011), "Date returns a time that is correct in one of the two zones involved in the transition, but it does not guarantee which."
- Oracle: MySQL 8.4 Reference Manual: Date and Time Functions Used for: FROM_UNIXTIME() returns values in the current session time zone, and UNIX_TIMESTAMP() assumes that its argument is a datetime value in the session time zone.
- MDN Web Docs: Intl.supportedValuesOf() Used for: "timeZone" is a valid key and the call returns a sorted array of unique values supported by the implementation.
Every document above was opened and read on 2026-10-03. Documentation changes; if a page here disagrees with the current docs, trust the docs and tell us.