# Unix Timestamp Converter

> Convert a Unix timestamp to a date and a date to a timestamp, in seconds or milliseconds, with time zones.

- Page: https://codethatmoves.com/tools/dev/timestamp-converter/
- Site: Code That Moves
- Category: Developer tools
- Free, runs in the browser, nothing is uploaded
- Last checked: 2026-11-03

## What it does

- Reads Unix timestamps in seconds, milliseconds, microseconds and nanoseconds, detected from the digits, with separators such as 1,700,000,000 or exponents such as 1.7e9
- Reads ISO 8601 and RFC 2822 dates and the word now
- Shows the result in UTC, in words and in any IANA time zone you search for, and gives exact µs and ns values
- Start and end timestamps of the day, week, month and year in the chosen zone
- Turns a date and time in a zone into a timestamp, and flags times that daylight saving skips or repeats
- Finds every timestamp and ISO date in a pasted log and converts them, with CSV export
- One-line snippets for the current timestamp in JavaScript, Python, Go, Java, C#, PHP, SQL and the shell
- A share link that opens the same timestamp, zone and wall-clock time
- A live current timestamp that you can copy in seconds or milliseconds

## How to use it

1. Paste a timestamp or a date. The unit is detected from the number of digits, and you can set it yourself.
2. Type a time zone name to show the date in it. Copy any value with its button, or copy the start and end of the period.
3. To go the other way, pick a date, a time and a zone in the lower section and copy the timestamp.
4. To convert a log, paste it into Convert every timestamp in a log and copy the table as CSV.

## What it checks and why

Unix time counts the seconds since 1 January 1970 at 00:00 UTC, the Unix epoch, ignoring leap seconds. It is the same number everywhere on Earth, which is why servers, databases and APIs use it: no time zone and no daylight saving to get wrong. Many systems use milliseconds instead, so 1700000000 and 1700000000000 are the same moment in different units. The converter tells them apart by the digits: ten is seconds, thirteen is milliseconds.

A person needs a date. The converter shows the moment in UTC, in the form that APIs expect (ISO 8601), in the older RFC 2822 form used by email and HTTP, and in any time zone with its offset from UTC. Time zone data comes from your browser, which keeps the IANA time zone database, so the offsets include daylight saving time as it was and will be.

The lower section goes the other way. You give a date and a time as they appear on a wall clock, and a zone, and it works out the instant. This is where daylight saving time bites: a clock time that does not exist on the night the clocks jump forward, or one that exists twice when they go back. The tool picks the earlier instant for an ambiguous time and shows the later one too, and moves a skipped time forward by the jump with a note. A date and time without a zone is read in your local time, while a date alone such as 2026-10-18 is midnight UTC, the JavaScript rule for ISO dates; the tool says which applied.

## Reference data

| Unit | Digits now | Example |
| --- | --- | --- |
| Seconds | 10 | 1700000000 |
| Milliseconds | 13 | 1700000000000 |
| Microseconds | 16 | 1700000000000000 |
| Nanoseconds | 19 | 1700000000000000000 |

## Specs and sources

- [POSIX: Seconds since the Epoch](https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16)
- [RFC 3339: Date and time on the Internet](https://datatracker.ietf.org/doc/html/rfc3339)
- [IANA time zone database](https://www.iana.org/time-zones)
- [MDN: Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)

## Limits

- JavaScript dates cover about 275 000 years around 1970. A value outside that range cannot be shown.
- Dates are shown to the millisecond, because JavaScript dates hold milliseconds. The µs and ns epoch values keep every digit you typed.
- The log converter finds 10, 13, 16 and 19 digit numbers and ISO date-times, the first 500 of them. Other numbers of that length, such as phone numbers, are converted too.
- Leap seconds are ignored, as in Unix time itself, so the value can differ from atomic time by a few seconds.
- Time zone rules come from your browser. An old browser can have an out-of-date list of daylight saving changes.

## Questions

### What is a Unix timestamp?

The number of seconds since 1 January 1970 at 00:00 UTC. It names a moment without a time zone, so a server in one country and a phone in another agree on it.

### How do I tell seconds from milliseconds?

Count the digits. A current timestamp in seconds has ten digits, such as 1700000000, and in milliseconds it has thirteen, such as 1700000000000. The converter detects it for you.

### What is the year 2038 problem?

A signed 32-bit counter of seconds overflows on 19 January 2038 at 03:14:07 UTC, the value 2147483647. Systems that still store time in 32 bits then wrap to 1901. Try 2038 in the tool to see it.

### Why does my date shift by some hours?

A date and time with no zone is read in your local time, while a date alone is read as midnight UTC, so the same text can land hours apart. Add Z or an offset such as +02:00, or choose the zone to show it in.

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

Date.now() returns the milliseconds since 1 January 1970 UTC. For a timestamp in seconds, use Math.floor(Date.now() / 1000).

### How do I get the current Unix timestamp in Python, SQL or bash?

Python: int(time.time()). PostgreSQL: extract(epoch from now())::bigint. MySQL: UNIX_TIMESTAMP(). Bash: date +%s. The tool lists these and the reverse conversions under Unix time in code.

### How do I get the timestamp for the start of a day?

Convert any moment of that day and read Start and end of the period: it gives the first and last second of the day, week, month and year in the zone you chose, with daylight saving applied.
