Updated 2026-11-07

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.

Unix time, units, and Europe/Dublin in practice

Unix time names an instant by counting seconds from 1970-01-01T00:00:00Z. JavaScript dates store milliseconds, so a seconds value is multiplied by 1,000 before it is passed to Date. This tool detects the common 10-digit seconds and 13-digit milliseconds forms, but the unit is part of the data contract: always check the producer before converting an unfamiliar value.

Four worked conversions

  1. Zero: 0 seconds becomes 1970-01-01T00:00:00.000Z.
  2. Seconds: 1717286400 becomes 2024-06-02T00:00:00.000Z. The same instant in milliseconds is 1717286400000, exactly 1,000 times larger.
  3. ISO to epoch: 2024-06-02T00:00:00Z returns 1717286400 seconds. Including Z avoids silently interpreting the string in a browser-local timezone.
  4. Log annotation: a line containing started_ms=1717286460000 is annotated with the corresponding ISO instant; the batch matcher leaves unrelated counters outside its supported date range alone.

UTC is the instant; Dublin is the presentation

2024-10-27T00:30:00Z is one instant. In Europe/Dublin the displayed clock changes around the autumn transition, so a local label can be an hour different before and after the change. It does not change the underlying timestamp, and Ireland is not a fixed offset year-round. For reproducible logs, store UTC or an ISO value with an offset, then render local time only at the presentation layer. The IANA time-zone database is the right reference for historical and future zone rules.

Failures worth checking

Negative values are valid for dates before 1970; fractional input may be rejected or rounded by the parser; a 13-digit number intended as seconds is a unit bug, not a timezone bug. Invalid dates, ambiguous strings without an offset, and values outside JavaScript's supported date range should be investigated at the source. Unix time also does not model leap seconds as extra counted seconds.

Make the timezone explicit

A timestamp converted to local time is useful for a person reading an incident, but UTC is usually safer for storage and comparison. Include the zone name or numeric offset when a local label is copied into a ticket. For Europe/Dublin, use the zone database rather than subtracting a permanent hour: the offset changes seasonally and historical rules can differ.

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.

Choose the right workflow

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");

Understand Unix time and Dublin time zones

Need more than a conversion? Read our developer guide to Unix time, UTC, and Europe/Dublin daylight saving time, then return here to test seconds, milliseconds, and log timestamps.

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).