Timestamp Converter: Unix Timestamp to Date and Back

Convert Unix timestamps to dates and dates back to timestamps.

Timestamp Converter tool

Timestamp to date

Seconds and milliseconds are both detected automatically.

Date to timestamp

—
Seconds
—
Milliseconds

About the Timestamp Converter

Databases, log files and APIs record time as a Unix timestamp, the number of seconds since the start of 1 January 1970 in UTC, which is precise but meaningless at a glance. This converter turns a Unix timestamp into a readable date and time in UTC and your local zone, and converts dates back into timestamps, in seconds or milliseconds, with ISO 8601 output for code: 1,800,000,000 seconds falls on 15 January 2027 at 08:00 UTC. Systems that store the value in a signed 32-bit number will overflow on 19 January 2038, which is worth knowing when testing older software. For the current time as a live timestamp, see the Unix Timestamp Generator, and for general date sums, the Date Calculator.

The converter works in both directions. Give it a number and it shows the instant in your own zone and in UTC, plus the standard text form that most web services expect. Give it a date instead and it returns the matching number, both in seconds and in milliseconds, ready for code, a database query or a test fixture.

Whether a pasted number counts seconds or milliseconds is worked out automatically, which removes the most common mistake: a value read with the wrong unit lands thousands of years in the future instead of next week. You are also told, in words, how distant that moment is from now, which is frequently the real question when reading a log.

How to use the Timestamp Converter

  1. Paste a timestampDrop in the number from your log or database; you do not need to say which unit it uses.
  2. Read the dateLocal time, UTC and the ISO 8601 form are shown together.
  3. Convert the other wayChoose a calendar day and clock time in the lower panel to receive the matching number.
  4. Copy a resultEvery output has its own copy button.

Timestamp Converter features

  • Seconds and milliseconds told apart automatically
  • Results in local time, UTC and ISO 8601
  • Relative wording such as three hours ago
  • Dates turned into timestamps in seconds and milliseconds
  • Day name and position in the year shown
  • Copy any single value
  • Uses your device's clock and time zone

Common uses

  • Making sense of times in server logs and crash reports
  • Checking when a token, cookie or cache entry expires
  • Producing the date format an API asks for
  • Tracking down a time zone mismatch between two systems
  • Working out how long ago a database record was created

Timestamps in practice: reading logs across time zones, ISO 8601 offsets, spreadsheets and precision

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Timestamps are how computers agree on moments in time, but people still have to read them, compare them and convert them into local time. Mistakes with time zones, units and formats cause some of the most confusing bugs in software and data analysis. This guide works through converting a log entry to Pakistan time, explains ISO 8601 offsets, shows how spreadsheets store dates and covers microsecond and nanosecond timestamps.

A worked example: a log entry

A server log records an error at timestamp 1793000000. Converted, that is 26 October 2026 at 07:33:20 UTC, which is 12:33:20 in Pakistan, five hours ahead of UTC. Customer complaints that arrived around half past twelve in Lahore can then be matched with the log entry. In the other direction, 25 October 2026 at 7:46 pm Pakistan time is 14:46 UTC, timestamp 1792939560.

Keeping server logs in UTC, and converting only when displaying times to people, prevents confusion between servers in different countries.

ISO 8601 with offsets

The ISO 8601 format writes dates as year, month, day, then time, such as 2026-10-25T19:46:00+05:00 for Pakistan time or 2026-10-25T14:46:00Z for UTC, where Z means zero offset. Including the offset makes a time unambiguous. Times written without an offset are a frequent cause of errors, because each system may assume a different zone.

Storing times in databases

A common rule is to store timestamps in UTC and convert to local time only when displaying them. For future events that depend on local time, such as a meeting at 9 am in a city that changes its clocks, also store the intended time zone, because the UTC equivalent may shift if daylight saving rules change.

Spreadsheets

Spreadsheets store dates as serial numbers of days since a starting date, not as Unix timestamps. In Excel and Google Sheets, a Unix timestamp in seconds in cell A1 converts with the formula =A1/86400+DATE(1970,1,1), formatted as a date and time, giving UTC. Adding 5/24 converts the result to Pakistan time.

Precision: seconds to nanoseconds

Timestamps come in different units. Ten-digit values are seconds, thirteen-digit values milliseconds, sixteen-digit values microseconds and nineteen-digit values nanoseconds, each from different systems and languages. Counting the digits is a quick way to identify the unit before converting.

JavaScript quirks

In JavaScript, Date.now() returns milliseconds, while many back-end systems use seconds, so values must be multiplied or divided by 1,000 when passing between them. JavaScript's Date object also numbers months from 0, so January is month 0, a classic source of off-by-one errors.

Daylight saving abroad

Pakistan does not change its clocks, but many countries do. Converting timestamps to local time in those countries must use the correct offset for each date, which changes twice a year. Using a proper time zone database, rather than a fixed offset, handles this correctly.

Comparing systems

When events from different systems are compared, small clock differences can make an effect appear before its cause. Servers synchronise their clocks with time servers to reduce this, but differences of milliseconds remain, which matters when analysing fast sequences of events.

Common mistakes

  • Mixing seconds and milliseconds.
  • Writing times without a time zone offset.
  • Storing local time without recording the zone.
  • Forgetting that spreadsheets use a different date system.

Related tools

For the current timestamp, use Unix Timestamp Generator. To convert between time zones, try Time Zone Converter, and for durations, Time Calculator.

Converting in code

Most languages convert timestamps easily: in JavaScript, new Date(seconds * 1000).toISOString() gives an ISO string in UTC, and in Python, datetime.fromtimestamp(seconds, timezone.utc) does the same after importing from the datetime module. Converting to UTC first, then to a named time zone, keeps results consistent.

Timestamps in file names

Timestamps are often embedded in file names, such as backups. A sortable format, such as 20261025-1446 for 14:46 on 25 October 2026, keeps files in order when listed alphabetically, and noting that the time is UTC avoids confusion across time zones.

Building a timeline

When investigating an incident, gathering timestamps from every relevant system, converting them to one time zone and sorting them into a single timeline often reveals the sequence of events quickly. Small offsets between systems should be noted rather than assumed away.

Dates far in the past or future

Negative timestamps represent dates before 1970, and very large values represent dates centuries ahead. Some older systems handle these poorly, so testing edge cases matters for applications dealing with birth dates, historical records or long-term contracts.

Timestamps in analytics

Analytics exports often record events as timestamps in UTC. When building daily reports for a Pakistani audience, converting to Pakistan time before grouping by day matters, because events between midnight and 5 am Pakistan time fall on the previous day in UTC and would otherwise be counted on the wrong date.

Privacy

Conversions run in your browser. Timestamps and dates you enter are not sent to a server.

Frequently asked questions

How does the converter tell seconds from milliseconds?

By the size of the number. Present-day moments need about ten digits when counted in seconds and about thirteen when counted in thousandths of a second, so the length gives the unit away. The unit it chose is displayed, so you can switch it for an unusual value.

Why is my local time different from the UTC time?

Local time includes your device's time zone offset and any daylight saving that applies on that date. Both are shown because servers and logs usually record UTC, while people think in their own local time.

What is ISO 8601?

A worldwide convention that writes the largest unit first, as in 2026-10-06T11:30:00Z for half past eleven UTC. Web services widely support it, alphabetical sorting puts it in time order, and it leaves no room to confuse day with month.

Can it handle dates before 1970?

Yes. Moments before 1 January 1970 are represented by negative timestamps, and the tool converts them correctly in both directions, so historical dates work as well as recent ones.

Are leap seconds taken into account?

No. Unix time ignores leap seconds by design, and so do browsers and nearly every database. For ordinary application work that is exactly the behaviour you want, since every day counts as 86,400 seconds.

Is anything sent to a server?

No. All conversions use the date functions built into your browser, and the current time comes from your device's clock, so the timestamps you check never leave your computer.