Convert Unix Timestamp to Date

Enter Unix timestamp (seconds or milliseconds)

Human-Readable Date
ISO 8601 Format
Unix Timestamp (milliseconds)
Unix Timestamp (seconds)

Last updated

What Is Unix Epoch Time?

Unix epoch time (also called Unix timestamp or POSIX time) is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC — the "Unix epoch." It's the most widely used time representation in computing because it's a simple integer, timezone-independent, and easy to compare and calculate with.

Epoch Time Formats

FormatExamplePrecision
Unix seconds17426016001 second
Unix milliseconds17426016000001 millisecond
Unix microseconds17426016000000001 microsecond
ISO 86012026-03-22T00:00:00Z1 second (or ms)
RFC 2822Sun, 22 Mar 2026 00:00:00 +00001 second

Conversion in JavaScript

JavaScript
// Current epoch time
const nowSeconds = Math.floor(Date.now() / 1000);
const nowMs      = Date.now();

// Epoch to Date
function epochToDate(epoch) {
  // Auto-detect seconds vs milliseconds
  const ms = epoch > 1e10 ? epoch : epoch * 1000;
  return new Date(ms);
}

// Date to epoch
function dateToEpoch(date, unit = 'seconds') {
  const ms = date instanceof Date ? date.getTime() : new Date(date).getTime();
  return unit === 'ms' ? ms : Math.floor(ms / 1000);
}

// Format epoch as human-readable
function formatEpoch(epoch, timezone = 'UTC') {
  const date = epochToDate(epoch);
  return date.toLocaleString('en-US', {
    timeZone: timezone,
    year: 'numeric', month: 'long', day: 'numeric',
    hour: '2-digit', minute: '2-digit', second: '2-digit',
    timeZoneName: 'short'
  });
}

console.log(formatEpoch(1742601600));
// → 'March 22, 2026 at 12:00:00 AM UTC'

Frequently Asked Questions

Enter the Unix timestamp (in seconds or milliseconds) and click Convert. The tool automatically detects the format and displays the date in multiple formats including ISO 8601.