π Epoch to Human Date
Paste a timestamp in seconds (10 digits) or milliseconds (13 digits).
π Human Date to Epoch
Select or enter any date and time to obtain its Unix timestamp.
π Quick Conversion Cheat Sheet & Developer Snippets
| Duration | Seconds | Common Usage |
|---|---|---|
| 1 Minute | 60 |
Short cache TTL / OTPs |
| 1 Hour | 3,600 |
Session / Auth tokens |
| 1 Day | 86,400 |
Daily cron jobs & logs |
| 1 Week | 604,800 |
Weekly backup cadence |
| 1 Month (30d) | 2,592,000 |
Monthly subscription billing |
| 1 Year (365d) | 31,536,000 |
SSL certs & annual cycles |
| 1 Leap Year (366d) | 31,622,400 |
Leap years (e.g. 2024, 2028) |
// Get current timestamp in seconds
const nowSec = Math.floor(Date.now() / 1000);
// Convert epoch seconds to Date
const date = new Date(1732203348 * 1000);
console.log(date.toUTCString());
// Convert Date to epoch seconds
const epochSec = Math.floor(new Date('2026-11-21T15:35:48Z').getTime() / 1000);
Comprehensive Guide to Unix Time & Epoch Timestamps
The Unix epoch (or Unix time, POSIX time, or Epoch time) is a universal system for describing a point in time. It measures the total number of non-leap seconds that have elapsed since the epoch point: 00:00:00 UTC on 1 January 1970.
Why Do Computers Use Unix Timestamps?
Representing dates as human strings (e.g., November 21, 2026, 9:05 PM IST) is notoriously fragile in computing due to time zones, Daylight Saving Time (DST) transitions, and diverse regional formatting styles (e.g., DD/MM/YYYY vs MM/DD/YYYY). In contrast, Unix time is a simple, monotonically increasing integer:
- Timezone-Independent: The exact same integer represents the identical instant in time regardless of whether your server is in London, New York, or Mumbai.
- Fast Mathematical Calculations: Calculating the difference between two timestamps requires a single integer subtraction (
t2 - t1). - Compact Storage: A 10-digit 32-bit or 64-bit integer takes only 4 to 8 bytes of storage in databases like PostgreSQL, MySQL, and SQLite.
Seconds vs. Milliseconds: How to Detect Which One You Have
A frequent issue for engineers is determining whether an API returns seconds or milliseconds:
- Seconds (10 digits): Currently starts with
17...(e.g.,1732203348). Typical in Linux shells, Python (time.time()), PHP (time()), and Redis TTLs. - Milliseconds (13 digits): Currently starts with
17...followed by three more digits (e.g.,1732203348000). Standard in JavaScript (Date.now()) and Java (System.currentTimeMillis()). - Microseconds (16 digits) & Nanoseconds (19 digits): Common in high-frequency trading (HFT), tracing systems (OpenTelemetry), and Go (
time.Now().UnixNano()).
Frequently Asked Questions (FAQ)
0, the clock struck midnight: Thursday, 1 January 1970 00:00:00 UTC. Prior dates (e.g., in the 1960s) are represented by negative signed integers.
2,147,483,647. At 03:14:07 UTC on January 19, 2038, the integer wraps around to -2,147,483,648, making systems believe it is December 13, 1901. Modern operating systems and 64-bit kernels have completely resolved this by adopting 64-bit integer representations.
Date and Intl.DateTimeFormat APIs.