# Epoch & Unix Timestamp Converter

> An epoch converter translates between Unix timestamps and human-readable dates in both directions. Unix time counts seconds since 1 January 1970 UTC, ignoring leap seconds, which is why it is the standard way to store an instant in a database or an API.

Source: https://rankcert.com/tools/epoch-converter
Free, no signup. Updated: 2026-08-29

## How to use it

1. Paste a timestamp in seconds or milliseconds - the length decides which.
2. Read it in UTC, ISO 8601 and your local timezone.
3. Or enter a date to get the timestamp back.

## Unix timestamp reference

Ten digits is seconds and thirteen is milliseconds. Reading one as the other is the single most common timestamp bug.

| Value | Meaning |
| --- | --- |
| 0 | 1 January 1970, 00:00:00 UTC - the epoch |
| 1000000000 | 9 September 2001 - the first ten-digit timestamp |
| 1700000000 | 14 November 2023 |
| 2147483647 | 19 January 2038 - signed 32-bit overflow |
| 86400 | Seconds in a day |
| 604800 | Seconds in a week |
| 2592000 | Seconds in 30 days |
| 31536000 | Seconds in a 365-day year |
| Math.floor(Date.now()/1000) | Current timestamp in JavaScript |
| date +%s | Current timestamp in a shell |
| extract(epoch from now()) | Current timestamp in Postgres |

## Questions

### Seconds or milliseconds?

Unix time is defined in seconds. JavaScript's Date.now returns milliseconds. A 10-digit number is seconds, a 13-digit number is milliseconds - mixing them is the single most common date bug there is.

### What is the year 2038 problem?

A signed 32-bit timestamp overflows on 19 January 2038. Anything storing time in a 32-bit integer breaks then. Use 64-bit integers or a native timestamp type.

### Does Unix time account for leap seconds?

No. It assumes every day is exactly 86,400 seconds, so it drifts from actual astronomical time. That is deliberate - it keeps the arithmetic simple.

### Why does my date show a day off?

Almost always a timezone issue. A date with no time component is midnight UTC, which is the previous day in any negative offset. Store and compare in UTC.

### Is my timestamp in seconds or milliseconds?

Count the digits. Ten digits is seconds and lands in the present; thirteen is milliseconds. A ten-digit value read as milliseconds gives a date in 1970, which is the classic symptom.

### What is the current Unix timestamp?

It increments every second. Get it with Math.floor(Date.now()/1000) in JavaScript, time.time() in Python, or date +%s in a shell.

### Why does my timestamp show the wrong day?

Timezone. A Unix timestamp is always UTC; the date you see depends on the zone used to format it. A midnight UTC timestamp is the previous evening in the Americas.

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

Store an instant as timestamptz in Postgres, which is a timestamp with the zone handled correctly. Store a calendar date with no time - a birthday, an invoice date - as a plain date, never as an epoch.

## Related tools

- [Barcode Generator](https://rankcert.com/tools/barcode-generator): Generate Code 128, EAN-13, UPC-A, Code 39, ITF-14, MSI and Pharmacode barcodes and download them as PNG. Runs entirely in your browser.
- [Code 128 Barcode Generator](https://rankcert.com/tools/code-128-barcode-generator): Generate a Code 128 barcode from any text or number and download it as a PNG. Full ASCII, automatic subset switching, no signup and nothing uploaded.
- [EAN-13 Barcode Generator](https://rankcert.com/tools/ean-13-barcode-generator): Generate a valid EAN-13 retail barcode, with the check digit calculated for you, and download it as a print-ready PNG. Free, no signup, nothing uploaded.
- [UPC Barcode Generator](https://rankcert.com/tools/upc-barcode-generator): Generate a 12-digit UPC-A retail barcode with the check digit calculated automatically, and download it as a print-ready PNG. Free and entirely in your browser.
- [Code 39 Barcode Generator](https://rankcert.com/tools/code-39-barcode-generator): Generate a Code 39 barcode from uppercase letters, digits and a handful of symbols, and download it as a PNG. Free, no signup, runs in your browser.
- [ITF-14 Barcode Generator](https://rankcert.com/tools/itf-14-barcode-generator): Generate an ITF-14 carton barcode from a 13 or 14 digit GTIN and download it as a PNG. Free, no signup, and the check digit is handled for you.