Epoch & Unix Timestamp Converter

Convert timestamps instantly. Nothing leaves your browser.

100% in your browser. Nothing uploaded.

Now
Enter a Unix timestamp above.
Enter a date string above.

Batch Log Converter


        
Paste log lines above and click Convert.

Convert Unix timestamps online without upload

This free epoch converter runs entirely in your browser. No data is sent to a server — making it safe to use with sensitive log files, internal timestamps, or production traces. Paste a Unix timestamp and get the equivalent UTC date, local time, ISO 8601, and a relative human description. Or go the other way: type a date and get the Unix timestamp in both seconds and milliseconds.

How to use the single converter

  1. Paste a Unix timestamp (seconds or milliseconds) into the left pane — the result appears instantly.
  2. To convert a date to a Unix timestamp, type it in the right pane. ISO 8601, RFC 2822, and plain YYYY-MM-DD all work.
  3. Click Now in either pane to pre-fill with the current time.
  4. Copy any row value with its inline Copy button.

How to use the batch converter

  1. Paste lines of log output into the Input pane (or click Sample to load an example).
  2. Click Convert. Every 10- or 13-digit timestamp in the text is annotated with its ISO date in square brackets.
  3. Click Copy output to paste the annotated log wherever you need it.

Seconds vs milliseconds

Unix time is officially defined in seconds. But most modern APIs and databases (JavaScript, Java, Python's time.time_ns, Redis, MongoDB) expose time in milliseconds or nanoseconds. This converter auto-detects the unit: numbers with 13 or more digits are treated as milliseconds; shorter numbers are treated as seconds. The batch converter applies the same heuristic to every number it finds in your log lines.

When to use it

Developer cheat sheet — Unix time in 8 languages

Quick reference for converting between Unix timestamps and dates in the languages you actually ship. Copy-paste, swap the example timestamp (1718544000) or date (2024-06-16), and you are done.

JavaScript

// Current timestamp (seconds)
const epoch = Math.floor(Date.now() / 1000);

// Convert timestamp to Date
const date = new Date(1718544000 * 1000);

// Convert Date to timestamp
const timestamp = Math.floor(new Date("2024-06-16").getTime() / 1000);

Python

import time
from datetime import datetime

# Current timestamp
epoch = int(time.time())

# Convert Epoch to human date
date = datetime.fromtimestamp(1718544000)
print(date.strftime("%Y-%m-%d %H:%M:%S"))

# Convert Date to Epoch
dt = datetime(2024, 6, 16)
epoch = int(dt.timestamp())

PHP

<?php
// Current timestamp
$epoch = time();

// Convert Epoch to date
echo date("Y-m-d H:i:s", 1718544000);

// Convert Date to Epoch
echo strtotime("2024-06-16");
?>

Java

// Current timestamp (seconds)
long epoch = System.currentTimeMillis() / 1000;

// Convert Epoch to Date
java.util.Date date = new java.util.Date(1718544000L * 1000);

// Convert Date to Epoch (Java 8+)
long timestamp = java.time.Instant.parse("2024-06-16T00:00:00Z").getEpochSecond();

C# (.NET)

// Current timestamp
long epoch = DateTimeOffset.UtcNow.ToUnixTimeSeconds();

// Convert Epoch to DateTimeOffset
DateTimeOffset dateTimeOffset = DateTimeOffset.FromUnixTimeSeconds(1718544000);

// Convert DateTime to Epoch
long timestamp = new DateTimeOffset(new DateTime(2024, 6, 16)).ToUnixTimeSeconds();

Bash / Shell

# Current timestamp
date +%s

# Convert Epoch to Date (Linux / GNU coreutils)
date -d @1718544000

# Convert Epoch to Date (macOS / BSD)
date -r 1718544000

Ruby

# Current timestamp
epoch = Time.now.to_i

# Convert Epoch to Time
time = Time.at(1718544000)

# Convert Time to Epoch
epoch = Time.parse("2024-06-16").to_i

SQL (MySQL & PostgreSQL)

-- MySQL: Convert Epoch to Date
SELECT FROM_UNIXTIME(1718544000);

-- MySQL: Convert Date to Epoch
SELECT UNIX_TIMESTAMP("2024-06-16 00:00:00");

-- PostgreSQL: Convert Epoch to Date
SELECT TO_TIMESTAMP(1718544000);

-- PostgreSQL: Convert Date to Epoch
SELECT EXTRACT(EPOCH FROM TIMESTAMP "2024-06-16 00:00:00");

FAQ

What is a Unix timestamp / epoch time?

A Unix timestamp is the number of seconds (or milliseconds) that have elapsed since 00:00:00 UTC on 1 January 1970, known as the Unix epoch. It is the most common way to represent a point in time in software: a single integer that is timezone-independent, compact, and easy to compare and store. The epoch is the reference point — time zero. Timestamps before 1970 are negative.

Is it safe to paste private log data here?

Yes. All conversion runs in JavaScript inside this browser tab. Nothing you paste is sent to any server, stored, or logged. You can use this tool offline once the page has loaded, which makes it suitable for air-gapped environments or when working with sensitive production traces.

Does it support milliseconds automatically?

Yes. If the number you enter has 13 or more digits, it is treated as milliseconds. Shorter numbers are treated as seconds. The same heuristic applies during batch conversion: every number in your log lines is checked against this threshold before it is annotated. This covers the overwhelming majority of real-world logs, which use either 10-digit (seconds) or 13-digit (milliseconds) timestamps.

How does the batch converter find timestamps in log lines?

It scans each line with a regular expression that matches standalone 10–13-digit integers (not embedded in longer numbers). Each match is checked: if the resulting date falls between 1970 and 2100, it is annotated with its ISO 8601 equivalent in square brackets. Matches that fall outside that range are left untouched so things like error codes or counters are not mistakenly converted.

What date formats does the date-to-timestamp converter accept?

Anything that the browser's built-in Date constructor can parse: ISO 8601 (e.g. 2024-06-02T00:00:00Z), bare date strings (2024-06-02, treated as UTC midnight), and RFC 2822 strings. Ambiguous formats without a timezone are interpreted according to the browser's local timezone, so prefer ISO 8601 with an explicit Z or offset for predictable results.

Does it work offline?

Yes, once the page has loaded. There are no runtime API calls, so the converter keeps working on a plane, behind a firewall, or after you disconnect from Wi-Fi.

What is the Year 2038 (Y2K38) problem?

Some older 32-bit systems store Unix time as a signed 32-bit integer, which overflows at 2147483647 — 03:14:07 UTC on 19 January 2038. After that point, the timestamp wraps to a negative number and dates are read as 13 December 1901. Modern 64-bit systems and most current programming languages use a 64-bit integer, which pushes the overflow far beyond any practical horizon. If you're still on a legacy 32-bit stack, plan a migration before 2038.

How do I convert an epoch timestamp in Excel or Google Sheets?

Excel and Google Sheets count days from 30 December 1899 (the "serial date" epoch), not from 1 January 1970. To convert a Unix timestamp in seconds in cell A1 into a Sheets date, use =A1/86400 + DATE(1970,1,1) and format the result as a date-time. For milliseconds, divide by 86400000 instead. Both formulas assume the value is in UTC; add or subtract hours to adjust for your timezone.

Why does Unix time start in 1970?

The Unix epoch — 00:00:00 UTC on 1 January 1970 — was chosen by early Unix engineers (Ken Thompson and Dennis Ritchie at Bell Labs) as a convenient round date close to the operating system's birth. It is far enough in the past to cover the modern era of computing without burning bits on dates nobody needs to represent, and recent enough that the count fits comfortably in 32-bit signed integers for several decades.

Is Unix time the same as UTC?

Unix time is closely related to UTC, but it is not identical. Unix time counts seconds since the epoch as if every day had exactly 86,400 seconds — it does not account for leap seconds. UTC, by contrast, occasionally inserts a leap second to stay aligned with astronomical time. For almost all software purposes the difference is invisible, but it can matter for high-precision time scales (astronomy, GPS, financial trading).