FREE UNIX TIMESTAMP CONVERTER

Epoch & Unix
time converter.

Convert epoch to date and date to Unix time.
Seconds to nanoseconds, in UTC or your local time zone.

Free, always Nanosecond precision No sign-up
THE CURRENT UNIX TIME
—
seconds
UTC / GMT
Local time
milliseconds—
microseconds—
✳ Your browser’s clock, updated every second.
01

Convert Unix timestamps and dates

Epoch timestamp to date

A timestamp in. A readable date out.

01 →

Auto-detect by digit count · seconds. Override for older dates.

CONVERSION RESULT
Jan 01, 2026, 00:00:00 UTC
UTC / GMTJan 01, 2026, 00:00:00 UTC
Local timeAvailable in your browser
ISO 8601
2026-01-01T00:00:00.000000000Z
View all timestamp units +
seconds
1767225600
milliseconds
1767225600000
microseconds
1767225600000000
nanoseconds
1767225600000000000
Supports seconds, milliseconds, microseconds & nanoseconds.

Date to Unix timestamp

A moment in time. In machine language.

02 →
UTC / GMT
↗
Every moment has a number.

Choose your date and time above
to find its Unix timestamp.

Converted in your browser. Nothing leaves your device.
02

Seconds to years, months, days & hours

THE DURATION CALCULATOR
00years
00months
11days
13hours
46minutes
40seconds

A breakdown using 365-day years and 30-day months. Calendar durations may vary.

03

Get the current Unix time in code

11 LANGUAGES. ONE MOMENT.

Get the current epoch time in code. Copy, paste, carry on.

epoch.js
// Current Unix timestamp in seconds
const epoch = Math.floor(Date.now() / 1000);
console.log(epoch);
 
// Convert a timestamp to a UTC date
const date = new Date(1767225600 * 1000);
console.log(date.toISOString());

Date.now() returns milliseconds. Divide by 1,000 for Unix seconds.

Browse all 11 epoch code examples +

Current epoch time in JavaScript

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

// Convert a timestamp to a UTC date
const date = new Date(1767225600 * 1000);
console.log(date.toISOString());

Date.now() returns milliseconds. Divide by 1,000 for Unix seconds.

Current epoch time in Python

import time
from datetime import datetime, timezone

# Current Unix timestamp in seconds
epoch = int(time.time())
print(epoch)

# Convert a timestamp to a UTC date
print(datetime.fromtimestamp(1767225600, timezone.utc))

Use time.time_ns() when you need an integer timestamp in nanoseconds.

Current epoch time in PHP

<?php
// Current Unix timestamp in seconds
$epoch = time();
echo $epoch;

// Convert a timestamp to a UTC date
echo gmdate('Y-m-d\TH:i:s\Z', 1767225600);

gmdate() formats in UTC; date() uses the configured default time zone.

Current epoch time in Java

import java.time.Instant;

class Epoch {
  public static void main(String[] args) {
    long epoch = Instant.now().getEpochSecond();
    System.out.println(epoch);
    System.out.println(Instant.ofEpochSecond(1767225600L));
  }
}

Instant is available in Java 8 and later. toEpochMilli() returns milliseconds.

Current epoch time in C

#include <stdio.h>
#include <time.h>

int main(void) {
    time_t now = time(NULL);
    printf("%lld\n", (long long) now);

    time_t epoch = (time_t) 1767225600;
    struct tm *utc = gmtime(&epoch);
    if (utc != NULL) {
        char date[32];
        strftime(date, sizeof date, "%Y-%m-%dT%H:%M:%SZ", utc);
        puts(date);
    }
    return 0;
}

On POSIX systems, time() returns seconds since the Unix epoch. The range depends on time_t.

Current epoch time in C++

#include <chrono>
#include <iostream>

int main() {
    const auto now = std::chrono::system_clock::now();
    const auto epoch = std::chrono::duration_cast<
        std::chrono::seconds>(now.time_since_epoch()).count();
    std::cout << epoch << '\n';
}

Use C++20 or later for the standard system_clock Unix epoch guarantee.

Current epoch time in C#

using System;

long epoch = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
Console.WriteLine(epoch);

var date = DateTimeOffset.FromUnixTimeSeconds(1767225600);
Console.WriteLine(date.ToString("O"));

ToUnixTimeMilliseconds() returns a millisecond timestamp.

Current epoch time in Ruby

# Current Unix timestamp in seconds
epoch = Time.now.to_i
puts epoch

# Convert a timestamp to a UTC date
puts Time.at(1767225600).utc

Time.at() accepts seconds. Call .utc to display the result in UTC.

Current epoch time in PostgreSQL

-- Current Unix timestamp in whole seconds
SELECT FLOOR(EXTRACT(EPOCH FROM clock_timestamp()))::bigint;

-- Convert a timestamp to a UTC date
SELECT to_timestamp(1767225600) AT TIME ZONE 'UTC';

clock_timestamp() returns the actual current time; now() returns the transaction start time.

Current epoch time in MySQL

-- Current Unix timestamp in seconds
SELECT UNIX_TIMESTAMP();

-- Display converted dates in UTC
SET time_zone = '+00:00';
SELECT FROM_UNIXTIME(1767225600);

FROM_UNIXTIME() uses the session time zone. Supported timestamp ranges vary by version and platform.

Current epoch time in SQL Server

-- Current Unix timestamp in seconds (SQL Server 2016+)
SELECT DATEDIFF_BIG(
    SECOND, '1970-01-01T00:00:00', SYSUTCDATETIME()
);

-- Convert this example timestamp to a UTC date
SELECT DATEADD(SECOND, 1767225600,
    CAST('1970-01-01T00:00:00' AS datetime2));

DATEDIFF_BIG avoids the 32-bit overflow in DATEDIFF. DATEADD argument limits depend on the SQL Server version.

MAKE IT YOURS

Your time, your way.

Preferences are saved in this browser.

Clock display
Default timestamp unit
Date input format
Date input time zone

Date entry always uses a 24-hour clock. Local dates use your browser’s time zone; repeated daylight saving times use the earlier occurrence. Live values have millisecond source precision.

THE REFERENCE DESK

What is the Unix epoch?

Unix time counts seconds since January 1, 1970 at 00:00:00 UTC.

IT ALL STARTED HEREJanuary 1, 1970 · 00:00:00 UTC

Unix time is the number of seconds that have passed since this moment. Also called epoch time or a POSIX timestamp, it gives computers a consistent way to store and compare an instant in time.

The timestamp itself has no time zone. UTC and local time are simply different ways to display the same instant. Leap seconds are not counted in Unix time.

A note on 2038. Signed 32-bit timestamps run out on January 19, 2038. Modern 64-bit systems support a much wider range of dates.

Explore the POSIX time standard
A quick measure of time IN SECONDS
Human timeSeconds
1 minute60
1 hour3,600
1 day86,400
1 week604,800
1 month (30 days)*2,592,000
1 year (365 days)*31,536,000

* Fixed approximations. Calendar months and years vary.

GOOD TO KNOW

Unix epoch time: common questions

What is a Unix timestamp?+

A Unix timestamp counts the seconds elapsed since January 1, 1970 at 00:00:00 UTC. Unix time does not count leap seconds. A timestamp identifies the same instant worldwide, regardless of the time zone used to display it.

How do I convert an epoch timestamp to a date?+

Paste your timestamp into the epoch-to-date converter, select its unit or use auto-detect, and choose Convert. The result shows UTC, local time, ISO 8601, and equivalent timestamps in all four units.

Is my timestamp in seconds or milliseconds?+

Contemporary timestamps usually have 10 digits in seconds, 13 in milliseconds, 16 in microseconds, or 19 in nanoseconds. Digit counts are only a heuristic: for older or far-future dates, select the unit explicitly.

Does a Unix timestamp have a time zone?+

No. A Unix timestamp represents an absolute instant measured from the UTC epoch. Time zones only change its displayed calendar date and clock time. Select UTC/GMT or your browser’s local time zone when converting a date back to a timestamp.

Are months and years exact durations?+

No. Calendar months and years have different lengths. This duration calculator uses a fixed 365-day year and a fixed 30-day month, then splits the remainder into days, hours, minutes, and seconds. It is an approximate duration, not calendar date arithmetic.

What is the Year 2038 problem?+

A signed 32-bit Unix seconds counter reaches its maximum value, 2147483647, on January 19, 2038 at 03:14:07 UTC. Systems using that representation need a larger time type. This converter uses integer arithmetic and is not limited by a signed 32-bit seconds counter.

UNDERSTAND YOUR TIMESTAMPS

Unix time and epoch conversion guides

Worked examples, time zones, and the details behind the numbers.