oktools

Unix Timestamp Converter

Convert Unix timestamps (epoch time) to readable dates and back, in your local time zone or UTC. This epoch converter reads seconds, milliseconds, microseconds and nanoseconds, and everything is computed in your browser — nothing is sent anywhere.

Seconds
Milliseconds
Microseconds
ISO 8601
0years since epoch
0months since epoch
0weeks since epoch
0days since epoch
0hours since epoch
0minutes since epoch
0seconds since epoch

Timestamp to date

No timestamp yet

Paste a Unix timestamp above, or press “Use now”.

Date to timestamp

No date yet

Pick a date and time above to get its Unix timestamp.

Add / subtract time

Starting from

No calculation yet

Enter an amount to shift the starting time forward or back.

Unix time counts the seconds elapsed since 00:00:00 UTC on 1 January 1970, ignoring leap seconds. Negative values are valid and point at dates before 1970.

Auto-detect reads values under 1011 as seconds, under 1014 as milliseconds, under 1017 as microseconds, and anything larger as nanoseconds. A fraction after a dot or comma (1700000000.123) is kept to the nanosecond, and a unit suffix such as ms or ns overrides detection.

It also accepts hexadecimal (0x6553f100), scientific notation (1.7e9), grouped digits (1,700,000,000), .NET /Date(…)/ values, MongoDB ObjectIds and UUID v1, v6 and v7. Windows FILETIME, .NET ticks, Apple Cocoa time and Excel serial dates are in the unit list.

How it works

Every input is turned into one exact instant: a count of nanoseconds since 1 January 1970 00:00:00 UTC, held as a bigint rather than a floating-point number, so a 19-digit nanosecond value or a fraction such as 1700000000.123456 is not rounded on the way through. Auto-detect reads the unit from the size of the whole-number part: below 10^11 is seconds, below 10^14 milliseconds, below 10^17 microseconds and anything larger nanoseconds. A suffix such as ms or ns overrides that, and so does picking a unit from the list, which also offers Windows FILETIME, .NET ticks, Apple Cocoa seconds and Excel serial dates, each counted from its own epoch.

Before the number is read, the text is tidied: quotes copied out of JSON are stripped, and digit grouping (1,700,000,000 or 1_700_000_000), a decimal comma, scientific notation such as 1.7e9 and hexadecimal such as 0x6553F100 are all accepted. Identifiers that carry a timestamp are recognised too: the .NET /Date(…)/ form, a MongoDB ObjectId, whose first four bytes are seconds, and UUID versions 1, 6 and 7. The result lists the instant in your local zone and in UTC, as ISO 8601 with and without the local offset, as a relative time, with the ISO week and the day of the year, and as seconds, milliseconds, microseconds and nanoseconds.

The other direction reads the date picker’s value with the browser’s own Date parser. A datetime-local value carries no zone, so it is taken as local time unless Interpret as UTC is ticked, which appends a Z; a value that already ends in Z or an offset is left alone. Add / subtract time shifts either the current time or the converted instant by a number of seconds, minutes, hours, days or weeks in plain arithmetic, a day always being 86 400 seconds, and the result can be sent back into the converter.

Examples

Convert a timestamp in seconds

Ten digits is a present-day value in seconds. The local-time rows depend on the zone of the browser the page is open in, so only the UTC rows are shown here.

Timestamp
1700000000
Result
Read as seconds
UTC: 2023-11-14 22:13:20 UTC
ISO 8601 (UTC): 2023-11-14T22:13:20.000Z
Milliseconds: 1700000000000

Convert a millisecond timestamp

Thirteen digits is milliseconds, as Date.now() and most JavaScript and Java APIs produce. The Seconds row truncates; the Seconds (decimal) row keeps the fraction and only appears when there is one.

Timestamp
1700000000123
Result
Read as milliseconds
ISO 8601 (UTC): 2023-11-14T22:13:20.123Z
Seconds: 1700000000
Seconds (decimal): 1700000000.123

Pull the time out of a MongoDB ObjectId

The first eight hex digits of an ObjectId are the creation time in seconds, so a document’s id says when it was inserted. A UUID v7 gives up its millisecond timestamp the same way, and a v4 UUID is reported as carrying no timestamp.

Timestamp
6553f100a1b2c3d4e5f60718
Result
Read as MongoDB ObjectId
UTC: 2023-11-14 22:13:20 UTC
Seconds: 1700000000

Turn a date into a timestamp

With Interpret as UTC ticked the typed time is the UTC instant itself. Unticked, it is read in the browser’s zone, so the same digits give a different timestamp in London and in Tokyo; for a time copied from a server log, UTC is usually the right reading.

Date (Interpret as UTC)
2025-01-15T14:30:00
Timestamp
Seconds: 1736951400
Milliseconds: 1736951400000
ISO 8601 (UTC): 2025-01-15T14:30:00.000Z

Supported formats

  • Unix time in four unitsSeconds, milliseconds, microseconds and nanoseconds, detected by magnitude or chosen from the list, with a decimal fraction kept to the nanosecond. Negative values reach back before 1970.
  • Numbers as people paste themQuoted values from JSON, digit grouping with commas, spaces or underscores, a decimal comma, scientific notation (1.7e9), hexadecimal (0x6553f100) and a unit suffix such as 1700000000ms.
  • Other epochsWindows FILETIME and Active Directory values (100 ns ticks since 1601), .NET DateTime.Ticks (since the year 1), Apple Cocoa and Core Data seconds (since 2001) and Excel serial dates (days since 1899-12-30, read as UTC).
  • Timestamps inside identifiers.NET /Date(1700000000000)/ JSON dates, MongoDB ObjectIds with or without the ObjectId(…) wrapper, and UUID v1, v6 and v7 with or without braces.
  • Dates outLocal and UTC in sortable form, ISO 8601 / RFC 3339 with Z or with the local offset, a relative time, the day of the week, the ISO week number and the day of the year.

Use cases

  • Read a timestamp from a log or a database rowPaste the number to see the moment in local time and UTC at once, which settles whether an entry is off by an hour or by a whole offset.
  • Check an expiry or a scheduled timeexp claims, cache TTLs and job schedules are stored as epoch seconds; paste one to see when it falls and how far away that is.
  • Date a MongoDB document or a UUID v7 recordThe id itself carries the creation time, so the age of a row is visible without a created_at column.
  • Convert a Windows, .NET or Excel timestampLDAP lastLogon values, DateTime.Ticks and spreadsheet serial dates do not count from 1970; pick the epoch from the list instead of doing the subtraction by hand.
  • Work out a deadline or a windowAdd 30 days to the converted instant, or subtract 24 hours from now, and copy the resulting seconds or milliseconds into a query.

Limitations

  • The timestamp field does not read dates2023-11-14 or 14 Nov 2023 typed into it is reported as not a timestamp. Use the date picker on the Date to timestamp card for a date written as text.
  • Only two zones are shownThe local rows use the browser’s zone and the others are UTC; there is no picker for a third zone. The Timezone Converter shows the same instant in several cities.
  • Leap seconds are ignoredUnix time counts every day as 86 400 seconds, as POSIX requires, and so does the converter; a TAI or GPS time is off by the current leap-second count.
  • Add / subtract works in fixed unitsA day is 24 hours and a week 7 days, so adding a day across a daylight-saving change lands an hour off the same wall-clock time, and there is no month or year unit. The offset is computed on the millisecond value.
  • The range is that of a JavaScript DateAbout 271 000 years either side of 1970. A value beyond that, such as a nanosecond count fed in as seconds, is reported as out of range rather than converted.

Frequently asked questions

What is a Unix timestamp?

The number of seconds elapsed since 1 January 1970 00:00:00 UTC, known as the epoch. Because it is a single integer in UTC with no time zone or formatting attached, it is what databases, log files and APIs store when they need a moment in time that cannot be misread.

Is my timestamp in seconds or milliseconds?

Count the digits. A present-day timestamp in seconds has 10; in milliseconds it has 13. If a date comes out in January 1970 you have fed seconds into a milliseconds field, and if it lands tens of thousands of years in the future you have fed milliseconds into a seconds field. Microseconds have 16 digits and nanoseconds 19, and a value with a decimal point such as 1700000000.123 is seconds with a fraction. All of them are detected here, so you can convert any of them without dividing by a thousand yourself.

How do I convert a timestamp to a readable date?

Paste the number into the timestamp field and the date is shown in your local time zone and in UTC together, along with the ISO 8601 form you would put in a JSON payload. Typing a date into the other field converts the other way.

Which time zone does the conversion use?

Both at once: your browser’s local zone and UTC are shown side by side, since a timestamp itself has no zone — it is an instant, and a zone only decides how that instant is written down. Seeing both is usually what settles an argument about whether a log entry is off by an hour or by a whole offset. Going the other way, a date you type is read in your local zone unless you tick "Interpret as UTC", which is what you want for a time copied out of a server log.

What is the year 2038 problem?

A timestamp stored in a signed 32-bit integer overflows on 19 January 2038, after which it wraps to a negative number and reads as 1901. Modern systems use 64-bit timestamps and are unaffected, but old file formats, embedded devices and some database columns are not, which is why the date is worth knowing about.

Can it convert a negative timestamp?

Yes. Negative values count backwards from the epoch, so they represent dates before 1970 — useful when a birth date or a historical record has been stored as an epoch value and comes back as a number that looks like an error.

Does anything get sent to a server?

No. The whole tool is JavaScript running in your own browser, so nothing you type or paste is sent over the network, written to a log or attached to an analytics event. You can confirm it by opening the network tab and watching it stay empty while you work.