Unix Timestamp Converter Tool

Convert between Unix timestamps (epoch time) and human-readable dates. Auto-detect s/ms, ISO 8601, RFC 2822, and more.

Last updated: 2026/03/02 Developer
Current Unix Timestamp
-
Seconds (s)
-
Milliseconds (ms)
Timestamp to Date
Date to Timestamp
Unix Seconds -
Unix Milliseconds -
ISO 8601 -
Code Snippets

Get Current Timestamp

// Seconds
Math.floor(Date.now() / 1000);

// Milliseconds
Date.now();

Timestamp to Date

const timestamp = 1709312400;
const date = new Date(timestamp * 1000);
console.log(date.toISOString());
// "2024-03-01T15:00:00.000Z"

Get Current Timestamp

import time

# Seconds
int(time.time())

# Milliseconds
int(time.time() * 1000)

Timestamp to Date

from datetime import datetime

timestamp = 1709312400
dt = datetime.fromtimestamp(timestamp)
print(dt.isoformat())
# "2024-03-02T00:00:00"

Get Current Timestamp

// Seconds
time();

// Milliseconds
(int)(microtime(true) * 1000);

Timestamp to Date

$timestamp = 1709312400;
echo date('c', $timestamp);
// "2024-03-02T00:00:00+09:00"

Get Current Timestamp

# Seconds
Time.now.to_i

# Milliseconds
(Time.now.to_f * 1000).to_i

Timestamp to Date

timestamp = 1709312400
time = Time.at(timestamp)
puts time.iso8601
# "2024-03-02T00:00:00+09:00"

Get Current Timestamp

import "time"

// Seconds
time.Now().Unix()

// Milliseconds
time.Now().UnixMilli()

Timestamp to Date

timestamp := int64(1709312400)
t := time.Unix(timestamp, 0)
fmt.Println(t.Format(time.RFC3339))
// "2024-03-02T00:00:00+09:00"

Get Current Timestamp

// Seconds
System.currentTimeMillis() / 1000;

// Milliseconds
System.currentTimeMillis();

// Java 8+
Instant.now().getEpochSecond();

Timestamp to Date

long timestamp = 1709312400L;
Instant instant = Instant.ofEpochSecond(timestamp);
ZonedDateTime zdt = instant.atZone(ZoneId.systemDefault());
System.out.println(zdt);
// "2024-03-02T00:00+09:00[Asia/Tokyo]"

Get Current Timestamp

// Seconds
DateTimeOffset.UtcNow.ToUnixTimeSeconds();

// Milliseconds
DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();

Timestamp to Date

long timestamp = 1709312400;
var dto = DateTimeOffset.FromUnixTimeSeconds(timestamp);
Console.WriteLine(dto.ToLocalTime());
// "2024/03/02 0:00:00 +09:00"

Get Current Timestamp

use std::time::{SystemTime, UNIX_EPOCH};

let timestamp = SystemTime::now()
    .duration_since(UNIX_EPOCH)
    .unwrap()
    .as_secs();

Timestamp to Date

// Using chrono crate
use chrono::{NaiveDateTime, TimeZone, Local};

let timestamp = 1709312400_i64;
let dt = Local.timestamp_opt(timestamp, 0).unwrap();
println!("{}", dt.to_rfc3339());
// "2024-03-02T00:00:00+09:00"

Get Current Timestamp

# Seconds
date +%s

# Milliseconds (GNU date)
date +%s%3N

# macOS
python3 -c "import time; print(int(time.time()))"

Timestamp to Date

# GNU/Linux
date -d @1709312400

# macOS
date -r 1709312400

# ISO 8601
date -d @1709312400 --iso-8601=seconds

Get Current Timestamp

-- MySQL
SELECT UNIX_TIMESTAMP();

-- PostgreSQL
SELECT EXTRACT(EPOCH FROM NOW())::INT;

-- SQLite
SELECT strftime('%s', 'now');

Timestamp to Date

-- MySQL
SELECT FROM_UNIXTIME(1709312400);

-- PostgreSQL
SELECT TO_TIMESTAMP(1709312400);

-- SQLite
SELECT datetime(1709312400, 'unixepoch', 'localtime');

How to Use

1

Enter a Timestamp or Date

Enter a Unix timestamp to convert to a date, or enter a date to convert to a timestamp.

2

View Results

Results are displayed in multiple formats including ISO 8601, RFC 2822, and relative time.

3

Copy and Use

Use the copy button next to each result to copy the format you need.

About Unix Timestamps

A Unix timestamp (epoch time) represents time as the number of seconds since January 1, 1970 00:00:00 UTC (Unix Epoch). It is widely used in programming and databases for timezone-independent time management.

Features

  • Auto Unit DetectionAutomatically detects seconds, milliseconds, microseconds, or nanoseconds from digit count.
  • Multiple FormatsView results in ISO 8601, RFC 2822, relative time, and more simultaneously.
  • Code SnippetsReady-to-use code samples in 10 programming languages.
  • Privacy ProtectedAll processing happens in your browser. No data is sent to servers.

Use Cases

  • Decode API response timestamps
  • Verify log file dates
  • Convert database datetime columns
  • Check JWT token expiration
  • Verify cron schedule times

FAQ

What is a Unix timestamp?
A Unix timestamp (epoch time) is the number of seconds elapsed since January 1, 1970 00:00:00 UTC. It is a standard way to represent time in programming and databases, providing a timezone-independent absolute time reference.
What is the Year 2038 problem?
Systems using 32-bit integers for timestamps will overflow on January 19, 2038 at 03:14:07 UTC. Most modern systems have migrated to 64-bit integers, resolving this issue.
What is the difference between seconds, milliseconds, and nanoseconds?
Seconds (10 digits) is the standard Unix timestamp. Milliseconds (13 digits) is used by JavaScript Date.now(). Microseconds (16 digits) and nanoseconds (19 digits) are used for high-precision measurements.
What is the difference between UTC and local time?
UTC (Coordinated Universal Time) is the world time standard. Unix timestamps are UTC-based, but can be displayed in any timezone. For example, JST (Japan Standard Time) is UTC+9.
Why does Unix Epoch start on January 1, 1970?
It was chosen as a convenient round date close to when Unix was developed. The 32-bit range provided sufficient coverage for both past and future dates at the time.
Can I determine the unit from the number of digits?
Yes, typically 10 digits means seconds, 13 digits means milliseconds, 16 digits means microseconds, and 19 digits means nanoseconds. This tool auto-detects the unit based on digit count.
Can negative timestamps be used?
Yes, negative values represent dates before January 1, 1970. For example, -86400 represents December 31, 1969. This tool supports negative values.