Unix Timestamp Converter
A live epoch clock, instant timestamp-to-date conversion in UTC and your local time, a date-to-timestamp direction, and a batch mode for whole log columns.
⏱️ Current Unix time
Ticking once a second, straight from your device clock.
Seconds, milliseconds, microseconds or nanoseconds — the unit is detected from the magnitude.
Local time appears once the page loads.
💻 Code snippets
Current timestamp
Instant.now().getEpochSecond();Math.floor(Date.now() / 1000)import time; int(time.time())time.Now().Unix()SELECT UNIX_TIMESTAMP();SELECT EXTRACT(EPOCH FROM NOW())::bigint;Convert this timestamp
Instant.ofEpochSecond(1758412800L).atZone(ZoneOffset.UTC);new Date(1758412800 * 1000).toISOString()datetime.fromtimestamp(1758412800, tz=timezone.utc)time.Unix(1758412800, 0).UTC()SELECT FROM_UNIXTIME(1758412800);SELECT to_timestamp(1758412800);How to use the timestamp converter
- The top panel shows the current Unix time in seconds and milliseconds, ticking once a second. Copy either value with one click.
- In Timestamp → date, paste any epoch value. The unit is detected automatically; use the dropdown to force it if you are working with historical data.
- Read the result in UTC, in your browser’s local timezone with its offset, and as ISO 8601 and RFC 2822 strings, plus a relative phrase such as “3 days ago”.
- Switch to Date → timestamp, pick a date and time, and choose whether that wall-clock value means your local time or UTC. The two differ by your offset.
- Use Batch to paste a whole column of timestamps, one per line. Mixed units are fine — each line is detected on its own — and the table exports to CSV.
How Unix time works
A Unix timestamp is the number of seconds since 1970-01-01T00:00:00Z. It has no timezone, no daylight-saving rules and no locale: it is a single integer naming an instant. Everything human-readable is a rendering of that integer.
Sub-second precision is expressed by scaling the same number:
| Unit | Digits today | Example | Where you see it |
|---|---|---|---|
| Seconds | 10 | 1758412800 |
Unix APIs, JWT exp, Go time.Unix |
| Milliseconds | 13 | 1758412800000 |
JavaScript Date.now(), Java System.currentTimeMillis() |
| Microseconds | 16 | 1758412800000000 |
PostgreSQL internals, many tracing systems |
| Nanoseconds | 19 | 1758412800000000000 |
Go UnixNano, Prometheus, Kafka internals |
The detection rule is simply magnitude: below 1e11 is treated as seconds, below 1e14 as milliseconds, below 1e17 as microseconds, and anything larger as nanoseconds. The seconds threshold corresponds to roughly the year 5138, so it will not mislabel anything you meet in practice.
Worked examples
A log line. 1758412800 converts to 2025-09-21 00:00:00 UTC — a Sunday. In ISO form that is 2025-09-21T00:00:00.000Z, and in RFC 2822 form Sun, 21 Sep 2025 00:00:00 +0000.
The same instant in milliseconds. 1758412800000 is the identical moment. Paste both into batch mode and the ISO column matches exactly, which is a quick way to check whether a system is emitting seconds or milliseconds.
Before the epoch. -86400 is exactly one day before the epoch: 1969-12-31 00:00:00 UTC. Negative timestamps are legal and useful for historical data, though some libraries reject them.
The 32-bit ceiling. 2147483647 is 2038-01-19 03:14:07 UTC, the last instant a signed 32-bit time_t can hold. One second later, a 32-bit system reads it as December 1901. The tool flags any timestamp past this point.
Local versus UTC entry. Entering 2025-09-21 09:00 as local time in a UTC+09:00 browser gives 1758412800, while entering the same wall-clock value as UTC gives 1758445200 — 32,400 seconds apart. Mixing these two is the single most common source of “the data is off by exactly N hours” bugs.
Getting the current timestamp in code
// Java
long epochSeconds = Instant.now().getEpochSecond();
// JavaScript — Date.now() returns milliseconds
const epochSeconds = Math.floor(Date.now() / 1000);
# Python
import time
epoch_seconds = int(time.time())
// Go
epochSeconds := time.Now().Unix()
-- MySQL
SELECT UNIX_TIMESTAMP();
SELECT FROM_UNIXTIME(1758412800);
-- PostgreSQL
SELECT EXTRACT(EPOCH FROM NOW())::bigint;
SELECT to_timestamp(1758412800);
Tips and common mistakes
- Do not divide by 1000 blindly. Check the digit count first, or let the tool detect it. A milliseconds value treated as seconds lands roughly 55,000 years in the future.
- Store instants, format later. Keep the integer in your database and render it per user timezone at display time. Storing a formatted local string throws away the information you need to correct it.
Date.now()is milliseconds. Most other languages’ “epoch now” is seconds. This mismatch is behind a large share of cross-service timestamp bugs.- Timestamps are not monotonic. NTP adjustments and manual clock changes can move wall-clock time backwards. For measuring elapsed time use a monotonic clock such as
performance.now()orSystem.nanoTime(). - Watch 32-bit columns. A MySQL
TIMESTAMPcolumn tops out in 2038;DATETIMEand a 64-bitBIGINTdo not. - Leap seconds vanish. Unix time defines every day as 86,400 seconds, so a leap second repeats or is smeared rather than counted. Never use a timestamp difference as a precise physical duration across a leap second boundary.
Glossary
- Epoch – the fixed reference instant, 1970-01-01T00:00:00Z.
- ISO 8601 – the
2026-09-21T00:00:00.000Zformat used by APIs and JSON. - RFC 2822 – the
Sun, 21 Sep 2026 00:00:00 +0000format used in email headers. time_t– the C type that holds a Unix timestamp; 32-bit versions overflow in 2038.
Privacy
The current time comes from your own device clock, and every conversion runs in JavaScript inside your browser tab. Nothing you paste — timestamps, log excerpts, batch columns — is uploaded, logged or stored on a server.
Frequently asked questions
How do I tell seconds from milliseconds?
By length. A current timestamp in seconds has 10 digits, in milliseconds 13, in microseconds 16 and in nanoseconds 19. This tool detects the unit from the magnitude, and you can override it if the value is from the distant past or future.
What is the Unix epoch?
Midnight UTC on 1 January 1970. A Unix timestamp counts the seconds elapsed since that instant, ignoring leap seconds, which is why it is a simple integer rather than a calendar.
Are Unix timestamps always UTC?
Yes. The value itself has no timezone; it identifies an instant. A timezone only enters when you format that instant as a wall-clock date, which is why this tool shows the same timestamp in both UTC and your local time.
What is the year 2038 problem?
Systems that store the timestamp in a signed 32-bit integer overflow at 03:14:07 UTC on 19 January 2038 and wrap around to 1901. Modern 64-bit time types push the limit hundreds of billions of years out, but embedded devices and old database columns can still be affected.
Why can a timestamp be negative?
Because dates before 1970 count backwards. -86400 is 31 December 1969. Some older systems reject negative values, so check before relying on them for historical data.
Does this tool handle leap seconds?
No, and neither does Unix time. A Unix day is always exactly 86,400 seconds, so a leap second is absorbed rather than counted. That is a deliberate part of the definition, not a rounding error.
Related tools
- Cron Expression GeneratorWrite a cron expression in Unix, Spring or Quartz form, read what it actually means in English, and see the next ten fire times in UTC and your local time.
- Date Difference CalculatorTwo calculators in one — the exact gap between two dates, including business days, and a date-maths mode that adds or subtracts any period.
- JSON Formatter & ValidatorPaste JSON, get it beautified, minified or validated with the exact line and column of the problem. Everything runs in your browser.
- Base64 Encoder & DecoderConvert text, files and data URIs to and from Base64 with correct UTF-8 handling, a URL-safe option and MIME line wrapping. Nothing is uploaded.
- Password GeneratorBuild a random password or a memorable passphrase with real cryptographic randomness. Entropy, strength and crack time are shown for the exact options you picked — and nothing ever leaves your browser.
- UUID GeneratorCreate random or time-ordered identifiers in bulk, format them for JSON, CSV or a SQL insert, and paste any existing id to find out which version it is and when it was made.
Last reviewed: