Unix Epoch & Date Format Converter
Convert between Unix timestamps, ISO 8601, RFC 2822, SQL datetimes, Excel serials and more. Covers every timestamp format you will meet.
The formats you will actually meet
| Format | Example | Where it appears |
|---|---|---|
| Unix seconds | 1736899200 | APIs, logs, databases |
| Unix milliseconds | 1736899200000 | JavaScript Date.now(), most modern APIs |
| ISO 8601 | 2025-01-15T10:30:00Z | JSON, most modern systems |
| RFC 2822 | Wed, 15 Jan 2025 10:30:00 GMT | HTTP headers, email |
| RFC 3339 | 2025-01-15T10:30:00+00:00 | Strict ISO profile with offset |
| SQL datetime | 2025-01-15 10:30:00 | MySQL, PostgreSQL |
| Excel serial | 45674 | Spreadsheets |
Seconds or milliseconds?
The digit count tells you. Ten digits is seconds, thirteen digits is milliseconds. JavaScript's Date.now() returns milliseconds, while Math.floor(Date.now() / 1000) returns seconds. Mixing them up is the single most common timestamp bug.
// Wrong - a 1000x error
new Date(1736899200) // 1970
new Date(1736899200000) // 2025
// Detect safely
const ms = Math.abs(t) < 1e11 ? t * 1000 : t;
The Excel serial number
Excel counts days from 30 December 1899 — an arbitrary choice that includes a deliberate bug for backwards compatibility with Lotus 1-2-3. Serial 1 is 1 January 1900, and 60 is the non-existent 29 February 1900. This is why the epoch for Excel conversions is 1899-12-30 rather than 1900-01-01.
Timezones
A Unix timestamp is always UTC — it has no timezone attached. When you display it, you convert. The tool shows both the UTC value and your browser's local time.
To convert in JavaScript:
new Date(ms).toISOString(); // UTC, always
new Date(ms).toLocaleString(); // local
new Date(ms).toLocaleString('en-GB', { timeZone: 'Asia/Tokyo' });
The 2038 problem
Timestamps stored as 32-bit signed integers overflow on 19 January 2038. If you maintain software with a long life ahead of it, use 64-bit integers or ISO 8601 strings.
Frequently asked questions
Is my timestamp sent anywhere?
No. The conversion happens entirely in your browser using the built-in Date object.
How does it tell seconds from milliseconds?
By the digit count. Values under 1e11 are treated as seconds and multiplied by 1000; anything larger is treated as milliseconds already.
What timezone is the output in?
The timestamp is always UTC, since that is what a Unix timestamp represents. The output shows the UTC value plus your browser's local time so you can verify it.
Why is the Excel epoch 1899?
Excel dates count from 30 December 1899 for backwards compatibility with Lotus 1-2-3, and it contains a deliberate leap-year bug for 1900. That is why conversions use 1899-12-30 as the reference.
What is the 2038 problem?
Timestamps stored in 32-bit signed integers overflow on 19 January 2038. Use 64-bit integers or ISO 8601 strings for anything long-lived.