EpochTools
Web

Unix Timestamps in JavaScript

Modern Node.js and browser JavaScript using Date and Date.now().

Complete JavaScript Recipe

// 1. Current timestamp in seconds & milliseconds
const currentSec = Math.floor(Date.now() / 1000);
const currentMs  = Date.now();

// 2. Convert timestamp (1710000000) to human-readable Date
const date = new Date(1710000000000);
console.log(date.toISOString()); // e.g. "2026-10-02T03:30:00.000Z"
console.log(date.toLocaleString()); // Local timezone string

// 3. Convert ISO string or Date to Unix timestamp
const epochSec = Math.floor(new Date("2026-10-02T12:00:00Z").getTime() / 1000);

Test With Live Converter

Epoch → Human Date

Paste any Unix timestamp. The unit is auto-detected from its magnitude.

Auto-detects seconds, milliseconds, microseconds, or nanoseconds. Example: 1735689600

Detected:Auto (Seconds)

UTC ISO 8601

–

Local — auto

–

RFC 2822 / GMT

–

Seconds Value

–

Relative Time

–