# Unix timestamp converter

URL: https://byshahid.com/tools/unix-timestamp-converter/
Author: Muhammad Shahid (https://byshahid.com/)
Free tool · runs in your browser

Convert a Unix timestamp (epoch time) to a readable date, or a date to a timestamp, and see the current time in seconds and milliseconds.

**Quick answer:** A Unix timestamp is the number of seconds since 1 January 1970 at 00:00 UTC. Paste one and the tool shows the date in UTC and in your local time zone; it detects milliseconds automatically (13 digits instead of 10). It also converts a date and time back into a timestamp.

## How to use it

1. **Paste a timestamp.** Seconds (10 digits) or milliseconds (13 digits) are detected automatically.
2. **Read the date.** You get the date in UTC, in your local time zone and in ISO 8601 format.
3. **Or pick a date.** Choose a date and time to get its timestamp in seconds and milliseconds.

## Example

A 10-digit timestamp in seconds, converted to dates:

Input:

```
1793520000
```

Output:

```
UTC:       Sunday, 1 November 2026, 08:00:00 UTC
ISO 8601:  2026-11-01T08:00:00.000Z
Local (UTC+5): Sunday, 1 November 2026, 13:00:00
Milliseconds: 1793520000000
```

## Common errors and how to fix them

- **The date is in January 1970**: A timestamp in seconds was read as milliseconds. Multiply by 1000 before passing it to new Date().
- **The year is in the tens of thousands**: A timestamp in milliseconds was read as seconds. Divide by 1000.
- **The time is off by a few hours**: Timestamps are UTC; the difference is your time zone. Format the date in the right time zone when you display it.
- **Invalid Date**: The value is not a number, for example a string with spaces or a date in a format the parser does not know. Convert it with Number() first, or use an ISO 8601 date.

## Frequently asked questions

### What is epoch time?

The number of seconds since 1 January 1970, 00:00:00 UTC. It is the same everywhere, regardless of time zone.

### Is my timestamp in seconds or milliseconds?

Current timestamps have 10 digits in seconds and 13 in milliseconds. JavaScript Date.now() returns milliseconds; most APIs and JWTs use seconds.

### How do I get the current timestamp in JavaScript?

Math.floor(Date.now() / 1000) for seconds, or Date.now() for milliseconds.

### Why is my date off by some hours?

The timestamp is in UTC; the difference is your time zone offset. Compare the UTC and local results.

### What is the year 2038 problem?

Systems that store timestamps as signed 32-bit integers overflow on 19 January 2038. Modern systems use 64-bit values.

### Do Unix timestamps include leap seconds?

No. Unix time ignores leap seconds, so every day is exactly 86,400 seconds.

### What is ISO 8601?

An international date format such as 2026-10-31T14:30:00Z, where the Z means UTC.

### How do I convert a timestamp in Python?

datetime.fromtimestamp(ts, tz=timezone.utc) gives a UTC date, and int(datetime.now(timezone.utc).timestamp()) gives the current timestamp.

### Can a Unix timestamp be negative?

Yes. Negative values are dates before 1 January 1970.

### Should I store dates as timestamps or strings?

Either works. Store times in UTC and convert to the user's time zone only when you display them.

## Related

- [JWT decoder (exp and iat are timestamps)](https://byshahid.com/tools/jwt-decoder/)
- [UUID generator](https://byshahid.com/tools/uuid-generator/)
- [JSON formatter and validator](https://byshahid.com/tools/json-formatter/)

## Sources

- [Wikipedia: Unix time](https://en.wikipedia.org/wiki/Unix_time)
