Epoch timestamp to date
A timestamp in. A readable date out.
Jan 01, 2026, 00:00:00 UTCAvailable in your browser2026-01-01T00:00:00.000000000ZView all timestamp units +
1767225600176722560000017672256000000001767225600000000000Convert epoch to date and date to Unix time.
Seconds to nanoseconds, in UTC or your local time zone.
——A timestamp in. A readable date out.
Jan 01, 2026, 00:00:00 UTCAvailable in your browser2026-01-01T00:00:00.000000000Z1767225600176722560000017672256000000001767225600000000000A moment in time. In machine language.
Choose your date and time above
to find its Unix timestamp.
A breakdown using 365-day years and 30-day months. Calendar durations may vary.
Get the current epoch time in code. Copy, paste, carry on.
// 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 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.
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.
<?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.
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.
#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.
#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.
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 Unix timestamp in seconds
epoch = Time.now.to_i
puts epoch
# Convert a timestamp to a UTC date
puts Time.at(1767225600).utcTime.at() accepts seconds. Call .utc to display the result in UTC.
-- 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 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 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.
Unix time counts seconds since January 1, 1970 at 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.
| Human time | Seconds |
|---|---|
| 1 minute | 60 |
| 1 hour | 3,600 |
| 1 day | 86,400 |
| 1 week | 604,800 |
| 1 month (30 days)* | 2,592,000 |
| 1 year (365 days)* | 31,536,000 |
* Fixed approximations. Calendar months and years vary.
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.
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.
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.
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.
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.
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.
Worked examples, time zones, and the details behind the numbers.
Understand Unix time, the January 1970 epoch, UTC and local dates, negative timestamps, and the Year 2038 problem with worked examples.
Read the Unix time guideIdentify seconds, milliseconds, microseconds, and nanoseconds. Compare timestamp units, preserve integer precision, and avoid common conversion mistakes.
Read the timestamp units guide