UNIX Timestamp Converter
Current UNIX Timestamp
Timestamp → Date and Time
Date and Time → Timestamp
This UNIX timestamp converter allows you to quickly convert UNIX time (epoch time / POSIX time) to date and time and vice versa. It supports timestamps in seconds and milliseconds, displays local time, UTC, and ISO 8601, and results can be copied with a single click.
What is UNIX Timestamp (Epoch Time / POSIX Time)?
A UNIX timestamp is a number that expresses time as the number of seconds since January 1, 1970, 00:00:00 UTC (the UNIX epoch). In practice, it is one of the most commonly used formats for storing and transmitting dates and times in systems, databases, APIs, and logging.
Example: 1700000000 corresponds to 14 November 2023, 22:13:20 UTC.
Why January 1, 1970?
The beginning of the epoch (1970-01-01) was chosen during the design of UNIX as a practical reference point: it is close to the period of the system’s creation and allows for simple time calculations.
UNIX Timestamp in Seconds vs. Milliseconds
UNIX timestamps most commonly appear in two forms:
| Timestamp Format | Example | Typical Use |
|---|---|---|
| Seconds (s) | 1700000000 | databases, backend, APIs, files |
| Milliseconds (ms) | 1700000000000 | JavaScript (Date.now()), analytics, detailed logs |
How to tell what you have?
- For “today’s” dates, seconds usually have 10 digits.
- Milliseconds usually have 13 digits and are roughly 1000× larger.
- If seconds mode receives a number with an absolute value of at least 10¹¹, this converter interprets it as milliseconds and shows a note. This is a magnitude-based heuristic; check the source unit.
How to Use the UNIX Timestamp Converter
1) Timestamp → Date and Time
- Enter the UNIX timestamp into the field, or click Now (for the current UNIX time).
- If the timestamp is in milliseconds, activate the Milliseconds option.
- Click Convert (or press Enter).
- The conversion to local time, UTC, and ISO 8601 will be displayed.
- Clicking on the result will copy it to the clipboard.
2) Date and Time → Timestamp
- Select the date and time in the form.
- The date and time are interpreted in your browser’s local time zone. Click Convert.
- Read the timestamp in both seconds and milliseconds.
Where is UNIX Timestamp Most Commonly Used?
You’ll encounter UNIX time virtually everywhere time is handled in IT:
- Databases – storing and comparing times in MySQL, PostgreSQL, SQLite, etc.
- APIs – REST/GraphQL often return time as a timestamp (easy serialization).
- Logs and Monitoring – precise ordering of events over time.
- Git – commits contain timestamp information.
- File Systems – times like mtime/ctime/atime (last modification, etc.).
- JWT – claims
iat(issued at) andexp(expires) are typically in epoch seconds. - Linux/Unix Shell –
date +%sreturns the current timestamp. - JavaScript –
Date.now()returns time in milliseconds.
Practical Examples of UNIX Time Conversion
JavaScript (timestamp ↔ date)
// Current UNIX timestamp in seconds
const tsSeconds = Math.floor(Date.now() / 1000);
// Current timestamp in milliseconds
const tsMs = Date.now();
// Timestamp (s) -> date
const dateFromSeconds = new Date(1700000000 * 1000);
console.log(dateFromSeconds.toISOString());
// Date -> timestamp (s)
const ts = Math.floor(new Date("2024-01-01T00:00:00Z").getTime() / 1000);
console.log(ts);
Python (timestamp ↔ datetime)
import time
from datetime import datetime, timezone
# Current timestamp in seconds
ts = int(time.time())
# Timestamp -> datetime (UTC)
dt_utc = datetime.fromtimestamp(1700000000, tz=timezone.utc)
# Date -> timestamp
ts2 = int(datetime(2024, 1, 1, tzinfo=timezone.utc).timestamp())
SQL (MySQL)
-- Current UNIX timestamp (s)
SELECT UNIX_TIMESTAMP();
-- Timestamp -> date
SELECT FROM_UNIXTIME(1700000000);
-- Date -> timestamp
SELECT UNIX_TIMESTAMP('2024-01-01 00:00:00');
MySQL interprets and displays these values using the session time zone. Specify the intended zone when comparing SQL output with UTC examples.
Time Zones: UTC, Local Time, and ISO 8601
A UNIX timestamp represents an instant relative to 1 January 1970 00:00:00 UTC. The number itself contains no time zone or daylight-saving flag. Its display as local time depends on the browser, server or library settings.
Concepts worth knowing:
- UTC – a global standard without daylight saving/winter time.
- GMT – practically identical to UTC for common use.
- Offset – the difference from UTC at a particular instant. A region’s offset may change with daylight saving.
UNIX Timestamp Limits and the Year 2038 Problem
The Year 2038 Problem
On some 32-bit systems, timestamps are stored as int32 with a maximum of 2,147,483,647, which corresponds to January 19, 2038, 03:14:07 UTC. Exceeding this value can lead to overflow and incorrect time. Modern 64-bit systems typically do not have this problem.
Range of 64-bit UNIX Time
Range depends on the data type and program. This converter uses JavaScript dates and cannot cover the full signed 64-bit integer range; unsupported dates are marked invalid. Negative epoch seconds indicate an instant before 1 January 1970.
FAQ – Frequently Asked Questions about UNIX Timestamp
Is UNIX timestamp in UTC, or local time?
It counts seconds from the UTC epoch and contains no time-zone identifier. Local time is a display of that instant using a particular zone. This converter shows UTC and your browser’s local time.How do I know if a timestamp is in seconds or milliseconds?
Check the source format. Contemporary epoch seconds usually have 10 digits and milliseconds 13. This converter treats a value with an absolute magnitude of at least 10¹¹ as milliseconds when seconds mode is selected and shows a note. Very old or far-future dates can make magnitude alone misleading.What does a negative UNIX timestamp mean?
A negative timestamp represents a date before January 1, 1970. For example,-1 corresponds to December 31, 1969, 23:59:59 UTC.
How to convert UNIX timestamp in SQL?
In MySQL, you useFROM_UNIXTIME(timestamp) and for the reverse, UNIX_TIMESTAMP(date). In PostgreSQL, it's typically TO_TIMESTAMP(timestamp) and EXTRACT(EPOCH FROM date).