Epoch & JWT Time

Unix Epoch & JWT Timestamp Converter

Convert Unix epoch seconds and milliseconds to UTC, ISO 8601, RFC 2822, and any IANA time zone locally in your browser. Generate ready-to-paste JWT NumericDate claim snippets (iat, nbf, exp) and inspect negative or Year-2038 boundary values.

How It Works

Unix epoch time counts elapsed seconds—excluding leap seconds—since 1970-01-01T00:00:00Z. RFC 7519 defines JWT time claims (exp, nbf, iat) as NumericDate integers in seconds, whereas JavaScript Date.now(), Java System.currentTimeMillis(), and many log shippers emit 13-digit milliseconds. Confusing seconds with milliseconds is a classic source of expired-token bugs and year-50000 dates.

This converter inspects input magnitude and lets you switch manually between seconds and milliseconds. Using browser-native Date and Intl.DateTimeFormat APIs, it renders UTC, ISO 8601, RFC 2822, browser local time, any IANA time zone, relative offsets, negative pre-1970 timestamps, and Year-2038 warnings when values exceed signed 32-bit integer limits (2,147,483,647).

Step-by-Step Guide & Real Example

Follow these four steps to translate numeric epochs into human dates, compute reverse timestamps, and copy JWT NumericDate claim blocks.

1. Inspect live time or enter an epoch value

Watch the live ticking Unix epoch clock at the top or type any seconds, milliseconds, or pre-1970 negative integer into the input box.

2. Confirm seconds vs. milliseconds detection

Auto mode switches at 1e11; use the manual toggle whenever converting small early-1970 millisecond values or far-future second values.

3. Compare UTC, RFC 2822, and IANA time zones

Select an IANA zone such as America/New_York or Asia/Riyadh to inspect regional business hours side-by-side with canonical ISO 8601 UTC output.

4. Copy JWT exp/nbf presets or test Year-2038 limits

Grab +15m, +1h, +24h, or +7d JSON claim blocks directly, or click 2147483647 to verify how 32-bit boundaries behave before 2038.

Worked Example: Signed 32-Bit Year-2038 Boundary

Epoch Timestamp (Seconds):2147483647 (2^31 - 1)
Converted Calendar & RFC Outputs:ISO 8601: 2038-01-19T03:14:07.000Z · RFC 2822: Tue, 19 Jan 2038 03:14:07 +0000 · Alert: Year-2038 Int32 max!

One second later (2147483648) overflows signed 32-bit integers to -2147483648 (1901-12-13). Store all JWT timestamps and database columns as 64-bit BIGINT/int64.

Common Mistakes & Security Notes

Supplying JavaScript milliseconds in JWT exp or iat claims

Passing Date.now() instead of Math.floor(Date.now() / 1000) sets token expiration tens of thousands of years into the future and breaks strict RFC 7519 validators.

Storing Unix timestamps in signed 32-bit INT database columns

Long-lived certificates, refresh windows, or financial schedules past January 19, 2038 fail or wrap negative on legacy 32-bit INT columns.

Forgetting UTC normalization when generating exp manually

Local server clocks with daylight saving transitions shift naive local timestamps; always generate and compare Unix epoch timestamps strictly in UTC.

Ignoring clock skew between auth issuers and resource APIs

Even NTP-synchronized containers drift by seconds; configure modest leeway (30–60s) on nbf and exp verification in production.

Unix Time Representations & Limits

RepresentationUnit & PrecisionOverflow HorizonWhere Used
JWT NumericDateSeconds (UTC integer/float)64-bit safe in modern JSON/JSJWT iat, nbf, exp claims (RFC 7519)
JavaScript Date.now()Milliseconds (UTC)±8.64e15 ms (~Year 275,760)Browser WebCrypto timers & Node.js Date
Signed 32-bit time_tSeconds (Int32)2038-01-19T03:14:07Z (2,147,483,647)Legacy C binaries, old MySQL INT schemas
Signed 64-bit BIGINTSeconds or Milliseconds> 292 billion years (seconds)Modern Postgres, JWT stores & audit logs

Code Snippets (Node.js, Python, Java)

Generate compliant JWT NumericDate seconds and format IANA time zones safely across backend stacks:

Node.js (TypeScript)
// JWT NumericDate claims in whole seconds (RFC 7519 Section 2)
const nowSeconds = Math.floor(Date.now() / 1000);
const payload = {
  sub: 'user_12345',
  iat: nowSeconds,
  nbf: nowSeconds,
  exp: nowSeconds + 900, // +15 minutes
};

const isoUtc = new Date(payload.exp * 1000).toISOString();
Python
from datetime import datetime, timezone, timedelta

now = datetime.now(timezone.utc)
iat = int(now.timestamp())
exp = int((now + timedelta(hours=1)).timestamp())

human_utc = datetime.fromtimestamp(exp, tz=timezone.utc).isoformat()
Java
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;

long nowEpochSec = Instant.now().getEpochSecond();
long expEpochSec = nowEpochSec + 3600; // +1 hour

String nyTime = DateTimeFormatter.ISO_OFFSET_DATE_TIME
    .withZone(ZoneId.of("America/New_York"))
    .format(Instant.ofEpochSecond(expEpochSec));

Frequently Asked Questions

Should JWT exp, iat, and nbf claims use seconds or milliseconds?

Always seconds. RFC 7519 defines NumericDate as the number of seconds from 1970-01-01T00:00:00Z UTC, never milliseconds.

How does auto-detection tell seconds apart from milliseconds?

Numbers with absolute magnitude of 100 billion (1e11) or larger are treated as milliseconds (~1973 or later in ms), while smaller values default to seconds. You can override this with the manual toggle.

What is the Year 2038 problem on Unix timestamps?

A signed 32-bit integer holds at most 2,147,483,647 seconds, which corresponds to 2038-01-19T03:14:07Z. Adding one second wraps legacy 32-bit systems back to December 1901.

Does this converter handle negative Unix timestamps before 1970?

Yes. Negative values count seconds or milliseconds backward from 1970-01-01T00:00:00Z; for example, -86400 seconds equals 1969-12-31T00:00:00Z.

Why does UTC differ from ISO 8601 and RFC 2822 output strings?

Both describe the exact same instant in UTC, but ISO 8601 uses 2026-11-19T12:00:00.000Z for machine APIs while RFC 2822 formats HTTP/email headers like Thu, 19 Nov 2026 12:00:00 +0000.

Are converted timestamps or dates sent to an external API?

No. Every conversion runs locally inside your browser using native JavaScript Date and Intl APIs.

About the author

Avada Labs builds free developer tools, including this site, with six years of experience in web development and online tools. Projects and source code are on GitHub.

Unix Timestamp Converter – Epoch to UTC, ISO & JWT exp