Developer Tools

Timestamp Converter

Convert Unix seconds or milliseconds to readable dates.

Browser workspace
LOCAL PROCESSING

Input stays in this browser while you use the tool.

About this tool

The Timestamp Converter turns a Unix timestamp into a date and time that people can read. A Unix timestamp is a single number that counts the time since 00:00:00 UTC on 1 January 1970, a moment known as the Unix epoch. For example, the value 1704067200 means 1 January 2024, 00:00:00 UTC. Computers like this format because one number is easy to store, sort, compare and calculate with, but a person cannot read it at a glance.

You will meet timestamps everywhere in software: in API responses, database columns, log files, cookies, cache headers, scheduled jobs and the exp and iat claims of a JSON Web Token. When something goes wrong, the first question is often "what moment does this number actually mean?" The converter answers that in a second, so you can check when an event happened, whether a token has expired or whether two records were created in the order you expect.

Timestamps come in two common units. A timestamp in seconds has 10 digits for dates between 2001 and 2286, and a timestamp in milliseconds has 13 digits, because it is the same moment multiplied by 1000. JavaScript and many web APIs use milliseconds, while Unix systems, PHP and many databases use seconds. Mixing the two up is the most frequent mistake, and the examples and the error section below show how to recognise it.

A Unix timestamp identifies one exact instant and does not depend on a time zone. The time zone only decides how that instant is written as a calendar date and time. The conversion runs in your browser, so the numbers you enter are processed on your own device and are not sent to the BitToolsKit server.

Use cases

  • Read dates in an API response. Fields such as created_at, updated or expires often hold a raw number. Convert it to see the real date.
  • Debug logs and database records. Check when an error, a login or a payment happened, and whether events are in the order you expect.
  • Check token and cookie expiry. The exp claim of a JSON Web Token and the expiry of a cookie are timestamps. Convert them to see whether they are already in the past.
  • Verify scheduled jobs and cache lifetimes. Confirm that a job, a cache entry or a countdown is set for the moment you intended.
  • Find unit mistakes. If a date shows 1970 or a year far in the future, converting the value shows at once that seconds and milliseconds were mixed up.
  • Compare two events. Convert both timestamps to see how far apart they are, or subtract the two numbers to get the gap in seconds.
  • Check data from a spreadsheet or an export. Make sure that a column of numbers really is a list of timestamps and covers the period you expect.
  • Learn how time is stored. Try a few values, such as 0 or 2147483647, to see how the epoch and the year 2038 limit work.

How to use

  1. Enter your Unix timestamp in the Input box, for example 1704067200 for seconds or 1704067200000 for milliseconds. Enter the number only, without quotation marks, commas or spaces.
  2. Click Run tool.
  3. Read the date and time in the Output box. Remember that a timestamp counts from the UTC epoch, so check whether the result is shown in UTC or in your local time zone before you compare it with another time.
  4. Check that the date makes sense. A date in January 1970 usually means a value in milliseconds was read as seconds, or the other way round, and a date thousands of years away means a very large value was read in the wrong unit. See the common errors below for the fixes.
  5. To go the other way, you can also enter a date and time in a standard format such as 2024-01-01T00:00:00Z and read the timestamp, if the tool offers it. Add a time zone or the letter Z for UTC, so that the result is not guessed from your own settings.
  6. Click Copy output to copy the result, Download to save it, or Clear to start again.

A quick rule for the unit: 10 digits usually means seconds and 13 digits usually means milliseconds. Values with 16 or 19 digits are microseconds or nanoseconds.

Examples

Example 1: A timestamp in seconds

Input:
1704067200
The date it represents:
2024-01-01 00:00:00 UTC (Monday, 1 January 2024)

Example 2: The same moment in milliseconds

Input:
1704067200000
The date it represents:
2024-01-01 00:00:00 UTC
A 13-digit value is in milliseconds. It is the seconds value multiplied by 1000.

Example 3: The Unix epoch itself

Input:
0
The date it represents:
1970-01-01 00:00:00 UTC
If you see this date for a real event, the timestamp was probably empty, zero or missing.

Example 4: The 32-bit limit

Input:
2147483647
The date it represents:
2038-01-19 03:14:07 UTC
This is the largest value a signed 32-bit integer can hold. Systems that store timestamps in 32 bits run out of range after this moment.

Example 5: What happens when the unit is misread

Input:
1704067200 (a value in seconds, read as milliseconds)
The date it represents:
About 20 January 1970, which is the wrong date. The same number read as seconds is 1 January 2024. A date in 1970 for a recent event is the typical sign of a unit mistake.

Example 6: A date converted to a timestamp

Input:
2024-01-01T00:00:00Z
Timestamp:
1704067200 (seconds) or 1704067200000 (milliseconds)

Common errors

The date is in January 1970

A value in seconds was read as milliseconds, or the number is very small or zero. A recent date written in seconds has 10 digits. Check the number of digits, and if the value is in seconds but was read as milliseconds, multiply it by 1000 before you convert it in code.

The year is thousands of years in the future, or the result is an invalid date

A value in milliseconds was read as seconds. A recent date in milliseconds has 13 digits. Divide the value by 1000 to get seconds.

The value has 16 or 19 digits

It is probably in microseconds (16 digits) or nanoseconds (19 digits), which some databases, programming languages and tracing systems use. Divide by 1,000,000 to get seconds from microseconds, or by 1,000,000,000 from nanoseconds.

The date or hour differs from what you expected

A timestamp is the same instant everywhere, but the written date depends on the time zone. 1704067200 is 2024-01-01 00:00 in UTC, 2023-12-31 19:00 in New York and 2024-01-01 05:00 in Karachi. Compare times in the same zone, and prefer UTC.

The time is wrong by exactly one hour

Daylight saving time is probably involved. A fixed offset such as UTC+1 does not change in summer, but a named zone such as Europe/London does. Convert in UTC, or make sure the same zone and the same rules are used on both sides.

The date is a day off near midnight

A moment close to midnight UTC falls on a different calendar day in zones ahead of or behind UTC. Check which zone the date is written in before you decide that the number is wrong.

The input is rejected or gives no result

Remove anything that is not part of the number: quotation marks, commas used as thousands separators, spaces, letters and units. Enter only digits, with a minus sign for dates before 1970 and a decimal point if the value contains fractions of a second.

The date is wrong by many years

The number may use another epoch than the Unix epoch. Windows FILETIME counts from 1601, Excel dates count days from 1900, .NET ticks start in the year 0001 and Apple's Cocoa dates start in 2001. Check which system produced the value.

A date in 2038 or a date in 1901 appears

The value comes from a system that stores the timestamp in a signed 32-bit integer. After 2038-01-19 03:14:07 UTC it wraps to a negative number, which reads as a date in 1901. Use a 64-bit integer for new systems.

A fractional timestamp such as 1704067200.123 is read as something else

The digits after the decimal point are fractions of a second, not a separate part. If your tool or your code expects a whole number, remove the fraction or multiply the value by 1000 to get milliseconds.

Frequently asked questions

What is a Unix timestamp?

A Unix timestamp is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970. It identifies one exact moment as a single number, which is easy for computers to store and compare.

What is the Unix epoch?

The epoch is the starting point of Unix time: 1 January 1970, 00:00:00 UTC. A timestamp of 0 is that moment, positive values are later and negative values are earlier.

How can I tell whether a timestamp is in seconds or milliseconds?

Count the digits. A date between 2001 and 2286 has 10 digits in seconds and 13 digits in milliseconds. If a converted date lands in 1970, or far in the future, the unit was probably misread.

Is a Unix timestamp affected by time zones?

No. A timestamp always refers to the same instant. The time zone only changes how that instant is written as a calendar date and time, for example 00:00 in London and 05:00 in Karachi.

Why does my timestamp show a date in 1970?

The value is probably very small, zero, or in seconds but was read as milliseconds. A value of 0 is exactly the epoch, 1 January 1970, and a recent time in seconds read as milliseconds gives a date in the first weeks of 1970.

What is the Year 2038 problem?

Systems that store timestamps in a signed 32-bit integer can only count up to 2147483647, which is 19 January 2038 at 03:14:07 UTC. After that the value wraps to a negative number. Modern systems use 64 bits, which lasts for billions of years.

Do Unix timestamps include leap seconds?

No. Unix time treats every day as exactly 86,400 seconds and ignores leap seconds, so it does not match every second counted by atomic clocks. For almost all software this makes no practical difference.

How do I get the current timestamp in code?

In JavaScript, Date.now() returns milliseconds and Math.floor(Date.now() / 1000) returns seconds. In Python, use int(time.time()), and in PHP use time().

How do I convert a date to a Unix timestamp?

If the tool accepts a date, enter it in a standard format such as 2024-01-01T00:00:00Z. In code, use Date.UTC in JavaScript, calendar.timegm in Python or strtotime in PHP, and always state the time zone so that the result is not based on a local setting.

Can a timestamp be negative?

Yes. A negative value is a moment before 1 January 1970, for example -86400 is 31 December 1969. Some older systems and libraries do not support negative timestamps.

Is my data sent to a server?

No. The tool runs in your browser and works on your device. As a general habit, avoid pasting passwords, API keys or private tokens into any online tool.

Related tools

Share this page