Converter Live Clock

Input

Enter timestamp or date

Quick Presets
Minute
Hour
Day
Week
Month
Year

Output

Converted formats

Timestamps
Seconds -
Milliseconds -
Microseconds -
Nanoseconds -
Local Time
12-Hour -
24-Hour -
GMT / UTC
12-Hour -
24-Hour -
ISO 8601 -

About Epoch Converter

Unix timestamp converter, epoch time converter, POSIX time converter

This epoch converter (also called unix timestamp converter, unix time converter, or linux timestamp converter) translates between two time formats: the numeric Unix timestamp and human-readable dates. It supports multiple precision levels — seconds, milliseconds, microseconds, and nanoseconds — making it suitable for everything from standard date conversions to high-precision timing applications.

How It Works

Unix time counts seconds from a fixed starting point: January 1, 1970, 00:00:00 UTC (called the "epoch"). So timestamp 0 = that exact moment, 86400 = exactly one day later, and 1704067200 = January 1, 2024.

To convert a timestamp to a date, the converter divides it by time intervals to extract years, months, days, hours, minutes, and seconds. To convert a date to timestamp, it counts the total seconds from 1970 to that date. The result is displayed in local time, UTC, and ISO 8601 formats.

Supported Precision Formats

This converter auto-detects and handles four precision levels:

  • Seconds (10 digits) — Standard Unix format, used by Python, PHP, Ruby, Unix/Linux systems
  • Milliseconds (13 digits) — Used by JavaScript, Java, and most modern APIs
  • Microseconds (16 digits) — For high-precision logging and database timestamps
  • Nanoseconds (19 digits) — Used in performance profiling and scientific applications

Common Time Intervals

1 minute 60 seconds
1 hour 3,600 seconds
1 day 86,400 seconds
1 week 604,800 seconds
1 year 31,536,000 seconds

Unix Timestamp Conversions

Convert between Unix timestamp, human-readable dates, and UTC formats using our free online timestamp converter.

Unix Timestamp to Date

Convert unix time to human-readable date

Use this unix timestamp converter to convert unix time to date instantly. Whether you need to convert a unix timestamp to datetime, get date from unix timestamp, or transform unix epoch to date — simply enter your timestamp above. Our epoch time converter automatically detects seconds (10 digits) or milliseconds (13 digits).

This tool handles all common formats: unix time to date, linux timestamp to date, posix timestamp to datetime, and epoch time to date conversions. The output shows your timestamp in local time, UTC, and ISO 8601 formats.

Unix Timestamp to Date Examples:

1704067200 Mon, Jan 1, 2024, 00:00:00 UTC
1704067200000 Mon, Jan 1, 2024, 00:00:00 UTC (milliseconds)
0 Thu, Jan 1, 1970, 00:00:00 UTC (Unix Epoch)

Date to Unix Timestamp

Convert date to epoch / unix time

Convert date to unix timestamp using the datetime picker or ISO 8601 input. This date to epoch converter generates both unix time in seconds and milliseconds. Use it to convert datetime to unix timestamp, transform human date to timestamp, or get the epoch timestamp for any date.

Perfect for converting date to unix, datetime to epoch, or time to unix timestamp. The converter supports local time and UTC inputs, making it easy to convert time to unix time accurately.

Date to Epoch Examples:

January 1, 2024 00:00 UTC 1704067200
2024-06-15T12:30:00Z 1718451000
December 31, 2024 23:59:59 UTC 1735689599

Unix Time to UTC

Convert epoch to UTC timestamp

Convert unix to utc with this epoch to utc converter. Unix timestamps are inherently UTC-based — epoch 0 is January 1, 1970 00:00:00 UTC. Use this tool to convert unix time to utc, transform epoch to utc timestamp, or get the utc timestamp from any unix time value.

The UTC output appears in the "GMT / UTC" section above, showing both 12-hour and 24-hour formats. The ISO 8601 output (ending in Z) is always in UTC. This utc timestamp converter is essential for working with timezone-independent time data.

Unix to UTC Examples:

1704067200 2024-01-01T00:00:00Z (UTC)
1704110400 2024-01-01T12:00:00Z (UTC)

Epoch Time Milliseconds

Unix timestamp in milliseconds

Work with epoch time milliseconds using this converter. JavaScript, Java, and modern APIs use unix timestamp in milliseconds (13 digits), while Unix/Linux systems use epoch seconds (10 digits). Our tool auto-detects the format and displays both.

Convert between epoch seconds and epoch milliseconds easily: multiply by 1000 to go from seconds to milliseconds, divide by 1000 for the reverse. The output panel shows your timestamp in seconds, milliseconds, microseconds, and nanoseconds.

Milliseconds Examples:

Seconds: 1704067200 Milliseconds: 1704067200000
Milliseconds: 1704067200500 Jan 1, 2024, 00:00:00.500 UTC

Convert Epoch Time in Code

How to convert unix time to date and date to epoch in popular programming languages.

JavaScript

JavaScript

JavaScript's built-in Date object works with milliseconds, so you need to multiply or divide by 1000 when working with unix timestamps in seconds. Use getTime() to convert a JavaScript date to epoch milliseconds, and pass epoch milliseconds directly to the Date constructor to convert epoch to date.

Epoch to Date
// Convert unix timestamp to date in JavaScript
const epochSeconds = 1704067200;
const date = new Date(epochSeconds * 1000);
console.log(date.toISOString()); // 2024-01-01T00:00:00.000Z
console.log(date.toLocaleString()); // Local format

// For epoch milliseconds (no multiplication needed)
const epochMs = 1704067200000;
const dateFromMs = new Date(epochMs);
Date to Epoch
// Convert JavaScript date to epoch timestamp
const now = new Date();
const epochMs = now.getTime();        // Milliseconds
const epochSec = Math.floor(now.getTime() / 1000); // Seconds

// Convert specific date string to unix timestamp
const specificDate = new Date('2024-01-01T00:00:00Z');
const timestamp = Math.floor(specificDate.getTime() / 1000);
Python

Python

Python's datetime module provides fromtimestamp() to convert epoch time to datetime, and timestamp() to convert Python datetime to epoch. Always use timezone.utc for consistent UTC conversions. For epoch time in Python, the timestamp() method returns seconds as a float.

Epoch to Date
from datetime import datetime, timezone

# Python convert epoch to datetime (local time)
epoch_seconds = 1704067200
dt_local = datetime.fromtimestamp(epoch_seconds)
print(dt_local)  # 2024-01-01 05:30:00 (depends on timezone)

# Python convert unix timestamp to datetime (UTC)
dt_utc = datetime.fromtimestamp(epoch_seconds, tz=timezone.utc)
print(dt_utc)  # 2024-01-01 00:00:00+00:00

# For epoch milliseconds, divide by 1000
epoch_ms = 1704067200000
dt = datetime.fromtimestamp(epoch_ms / 1000, tz=timezone.utc)
Date to Epoch
from datetime import datetime, timezone

# Python datetime to epoch (current time)
now = datetime.now(timezone.utc)
epoch_seconds = int(now.timestamp())

# Python convert datetime to unix timestamp
dt = datetime(2024, 1, 1, 0, 0, 0, tzinfo=timezone.utc)
epoch = int(dt.timestamp())  # 1704067200
MySQL

MySQL

MySQL provides FROM_UNIXTIME() to convert unix timestamp to datetime, and UNIX_TIMESTAMP() to convert datetime to epoch. These functions work with seconds, so divide millisecond timestamps by 1000. You can also format the output using MySQL's date format specifiers.

Epoch to Date
-- MySQL convert unix timestamp to datetime
SELECT FROM_UNIXTIME(1704067200);
-- Result: 2024-01-01 00:00:00

-- MySQL convert epoch to date with custom format
SELECT FROM_UNIXTIME(1704067200, '%Y-%m-%d %H:%i:%s');

-- For milliseconds, divide by 1000
SELECT FROM_UNIXTIME(1704067200000 / 1000);
Date to Epoch
-- MySQL convert datetime to unix timestamp
SELECT UNIX_TIMESTAMP('2024-01-01 00:00:00');
-- Result: 1704067200

-- MySQL get current epoch timestamp
SELECT UNIX_TIMESTAMP(NOW());
PostgreSQL

PostgreSQL

PostgreSQL uses to_timestamp() to convert unix timestamp to date, and EXTRACT(EPOCH FROM ...) to convert epoch to timestamp. Use AT TIME ZONE for timezone conversions. PostgreSQL convert epoch to timestamp returns a timestamp with time zone by default.

Epoch to Date
-- PostgreSQL convert unix timestamp to date
SELECT to_timestamp(1704067200);
-- Result: 2024-01-01 00:00:00+00

-- PostgreSQL convert epoch to timestamp with timezone
SELECT to_timestamp(1704067200) AT TIME ZONE 'UTC';

-- For milliseconds, divide by 1000
SELECT to_timestamp(1704067200000 / 1000.0);
Date to Epoch
-- PostgreSQL convert timestamp to unix epoch
SELECT EXTRACT(EPOCH FROM TIMESTAMP '2024-01-01 00:00:00');
-- Result: 1704067200

-- PostgreSQL get current epoch timestamp
SELECT EXTRACT(EPOCH FROM NOW());

Java

Java's Instant class (Java 8+) handles epoch time natively. Use Instant.ofEpochSecond() for seconds or Instant.ofEpochMilli() for milliseconds.

Epoch to Date
import java.time.*;

// Java convert epoch to date
long epochSeconds = 1704067200L;
Instant instant = Instant.ofEpochSecond(epochSeconds);
ZonedDateTime utc = instant.atZone(ZoneOffset.UTC);
// 2024-01-01T00:00:00Z

// For milliseconds
Instant fromMs = Instant.ofEpochMilli(1704067200000L);
Date to Epoch
// Java convert date to epoch
Instant now = Instant.now();
long epochSec = now.getEpochSecond();
long epochMs = now.toEpochMilli();

// From specific date
long epoch = LocalDateTime.of(2024, 1, 1, 0, 0)
    .toEpochSecond(ZoneOffset.UTC);

Go

Go's time package uses Unix() to create time from epoch and Unix() method to get epoch from time.

Epoch to Date
import "time"

// Go convert epoch to time
epochSec := int64(1704067200)
t := time.Unix(epochSec, 0).UTC()
// 2024-01-01 00:00:00 +0000 UTC

// For milliseconds
epochMs := int64(1704067200000)
t := time.UnixMilli(epochMs).UTC()
Date to Epoch
// Go convert time to epoch
now := time.Now()
epochSec := now.Unix()
epochMs := now.UnixMilli()

// From specific date
t := time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC)
epoch := t.Unix() // 1704067200

Rust

Rust's chrono crate provides comprehensive time handling with DateTime and Utc types.

Epoch to Date
use chrono::{DateTime, Utc};

// Rust convert epoch to datetime
let epoch_sec = 1704067200_i64;
let dt = DateTime::from_timestamp(epoch_sec, 0)
    .unwrap();
// 2024-01-01T00:00:00Z

// For milliseconds
let dt = DateTime::from_timestamp_millis(1704067200000)
    .unwrap();
Date to Epoch
// Rust convert datetime to epoch
let now: DateTime<Utc> = Utc::now();
let epoch_sec = now.timestamp();
let epoch_ms = now.timestamp_millis();

PHP

PHP uses date() with epoch seconds and strtotime() or DateTime for conversions.

Epoch to Date
// PHP convert epoch to date
$epoch = 1704067200;
$date = date('Y-m-d H:i:s', $epoch);
// 2024-01-01 00:00:00

// Using DateTime
$dt = new DateTime("@$epoch");
$dt->setTimezone(new DateTimeZone('UTC'));
Date to Epoch
// PHP convert date to epoch
$epoch = time(); // current timestamp
$epoch = strtotime('2024-01-01 00:00:00 UTC');

// Using DateTime
$dt = new DateTime('2024-01-01', new DateTimeZone('UTC'));
$epoch = $dt->getTimestamp();

Frequently Asked Questions

How do I convert unix timestamp to date?

Enter your unix timestamp in the input field. The epoch converter instantly shows the date in local time, UTC, and ISO 8601 formats. Works with both seconds and milliseconds.

How do I convert date to unix timestamp?

Use the Local or UTC datetime picker to select your date. The converter instantly generates the unix timestamp in seconds and milliseconds format.

How do I convert unix time to UTC?

Unix timestamps are inherently UTC-based. Enter your timestamp and view the "GMT / UTC" section for UTC output. The ISO 8601 format (ending in Z) is always UTC.

What is the current epoch time?

Click "Set Current Time" to see the current unix timestamp now. You can also visit our live unix epoch clock to see the current epoch time updating in real-time.

What's the difference between epoch seconds and milliseconds?

Epoch seconds (10 digits) is used by Unix/Linux, Python, PHP. Epoch milliseconds (13 digits) is used by JavaScript, Java. Our converter auto-detects both formats.

Is this timestamp converter free?

Yes, this unix time converter is 100% free. No signup, no limits. All conversions run in your browser — your data stays private.