Zero is a birthday
A timestamp of 0 is the exact start of the Unix Epoch: 1970-01-01T00:00:00Z
(UTC).
A timestamp of 0 is the exact start of the Unix Epoch: 1970-01-01T00:00:00Z
(UTC).
10 digits = seconds; 13 digits = milliseconds. Add or remove three zeros to hop between them.
Timestamps are timezone-agnostic. London, New York, or Tokyo show different local times—but it’s the same moment.
On 2038-01-19 03:14:07 UTC, 32-bit second counters overflow. Modern 64-bit systems avoid this.
In ISO-8601, the trailing Z (e.g., 2025-03-01T10:30:00Z
) means UTC—the same time everywhere.
A UNIX timestamp (often called epoch time) is a single number that counts how much time
has passed since the Unix Epoch: 1970-01-01T00:00:00Z
(UTC). It’s widely used in logs,
databases, and APIs because it’s compact, sortable, and timezone-agnostic.
1700000000
)1700000000000
)1700000000000000
)-31536000
→ 1969-01-01T00:00:00Z).2147483647
→ 2038-01-19T03:14:07Z. Modern systems use 64-bit and don’t suffer this limit.Meaning | Seconds | Milliseconds | UTC (ISO-8601) |
---|---|---|---|
Epoch start | 0 |
0 |
1970-01-01T00:00:00Z |
One billion seconds | 1000000000 |
1000000000000 |
2001-09-09T01:46:40Z |
2038 boundary (32-bit) | 2147483647 |
2147483647000 |
2038-01-19T03:14:07Z |
Example current-era | 1600000000 |
1600000000000 |
2020-09-13T12:26:40Z |
2025-03-01T10:30:00Z
or with an offset (e.g., +01:00
).2025-03-01 10:30:00
→ local time2025-03-01T10:30:00Z
→ UTC (the trailing Z
means Zulu/UTC)2025-03-01T10:30:00+05:30
→ UTC+5:301,000,000
to get milliseconds.Date
, browsers, most front-end code.Date
.Copy–paste friendly snippets for common tasks: get current epoch, convert a human date → epoch, and convert epoch → date.
// current epoch
const s = Math.floor(Date.now() / 1000); // seconds
const ms = Date.now(); // milliseconds
// date → epoch
const dt = new Date("2025-03-01T10:30:00Z");
const epochSeconds = Math.floor(dt.getTime() / 1000);
// epoch → date
const d1 = new Date(1700000000 * 1000); // seconds → ms
const d2 = new Date(1700000000000); // ms
import time, datetime, calendar
# current epoch
sec = time.time() # float seconds
ms = round(time.time()*1000)
# date → epoch (UTC)
dt = datetime.datetime(2025, 3, 1, 10, 30, tzinfo=datetime.timezone.utc)
epoch_seconds = int(dt.timestamp())
# epoch → date (UTC)
dt2 = datetime.datetime.fromtimestamp(1700000000, tz=datetime.timezone.utc)
import java.time.*;
long sec = Instant.now().getEpochSecond(); // current epoch (s)
long ms = Instant.now().toEpochMilli(); // current epoch (ms)
// date → epoch
Instant ins = Instant.parse("2025-03-01T10:30:00Z");
long epochSeconds = ins.getEpochSecond();
// epoch → date
Instant ins2 = Instant.ofEpochSecond(1700000000);
ZonedDateTime zdt = ins2.atZone(ZoneId.of("UTC"));
using System;
long sec = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
long ms = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
// date → epoch
var dto = new DateTimeOffset(2025, 3, 1, 10, 30, 0, TimeSpan.Zero);
long epochSeconds = dto.ToUnixTimeSeconds();
// epoch → date
var dto2 = DateTimeOffset.FromUnixTimeSeconds(1700000000); // UTC
package main
import ("fmt"; "time")
func main() {
sec := time.Now().Unix() // seconds
ms := time.Now().UnixMilli() // milliseconds
// date → epoch (UTC)
t, _ := time.Parse(time.RFC3339, "2025-03-01T10:30:00Z")
fmt.Println(t.Unix())
// epoch → date
t2 := time.Unix(1700000000, 0).UTC()
fmt.Println(t2.Format(time.RFC3339))
}
// current epoch
$sec = time(); // seconds
$ms = round(microtime(true)*1000);
// date → epoch (UTC recommended)
$dt = new DateTime("2025-03-01T10:30:00Z");
$epoch = $dt->getTimestamp();
// epoch → date
$dt2 = (new DateTime())->setTimestamp(1700000000)->setTimezone(new DateTimeZone("UTC"));
echo $dt2->format(DATE_RFC3339);
# current epoch
s = Time.now.to_i # seconds
ms = (Time.now.to_f*1000).to_i
# date → epoch (UTC)
t = Time.utc(2025,3,1,10,30,0)
s2 = t.to_i
# epoch → date
t2 = Time.at(1700000000).utc
use std::time::{SystemTime, UNIX_EPOCH, Duration};
// current epoch
let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
let sec = now.as_secs();
let ms = now.as_millis();
// epoch → date (example with chrono)
use chrono::{DateTime, Utc, TimeZone};
let d: DateTime<Utc> = Utc.timestamp_opt(1_700_000_000, 0).unwrap();
import java.time.Instant
import java.time.ZoneId
val sec = Instant.now().epochSecond
val ms = Instant.now().toEpochMilli()
// date → epoch
val ins = Instant.parse("2025-03-01T10:30:00Z")
val epochSeconds = ins.epochSecond
// epoch → date
val zdt = Instant.ofEpochSecond(1700000000).atZone(ZoneId.of("UTC"))
import Foundation
let sec = Int(Date().timeIntervalSince1970) // seconds
let ms = Int(Date().timeIntervalSince1970 * 1000)
// date → epoch (ISO8601)
let iso = ISO8601DateFormatter().date(from: "2025-03-01T10:30:00Z")!
let epoch = Int(iso.timeIntervalSince1970)
// epoch → date
let d = Date(timeIntervalSince1970: 1700000000)
#include <chrono>
using namespace std::chrono;
// current epoch
auto now = system_clock::now();
auto sec = duration_cast<seconds>(now.time_since_epoch()).count();
auto ms = duration_cast<milliseconds>(now.time_since_epoch()).count();
// epoch → time_point
auto tp = system_clock::time_point{seconds{1700000000}};
# current epoch
date +%s # seconds
python3 - <<'PY'\nimport time; print(round(time.time()*1000))\nPY # ms fallback
# date → epoch (UTC)
date -u -d "2025-03-01 10:30:00" +%s
# epoch → date (local or -u for UTC)
date -d @1700000000
# current epoch
$sec = [int][double]::Parse((Get-Date (Get-Date).ToUniversalTime() -UFormat %s))
$ms = [int]([DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds())
# epoch → date
[DateTimeOffset]::FromUnixTimeSeconds(1700000000).UtcDateTime
-- current epoch (seconds)
SELECT EXTRACT(EPOCH FROM NOW());
-- date → epoch (UTC)
SELECT EXTRACT(EPOCH FROM TIMESTAMP '2025-03-01 10:30:00+00');
-- epoch → timestamp
SELECT TO_TIMESTAMP(1700000000) AT TIME ZONE 'UTC';
-- current epoch
SELECT UNIX_TIMESTAMP();
-- date → epoch (assumes UTC string if suffixed with 'Z')
SELECT UNIX_TIMESTAMP('2025-03-01 10:30:00');
-- epoch → datetime
SELECT FROM_UNIXTIME(1700000000);
Tip: prefer ISO-8601 strings (e.g., 2025-03-01T10:30:00Z
) for unambiguous UTC. If an API expects seconds but you have milliseconds, divide by 1000 (and multiply for the reverse).
No. The timestamp encodes an absolute moment; only its display changes with time zone or DST rules.
Back-end systems and APIs often use seconds; browsers and JavaScript typically use milliseconds. This tool handles both.
Yes—use the UTC output for ISO-8601 style strings like YYYY-MM-DDTHH:mm:ssZ
.
Yes. Everything is calculated in your browser, with no network requests for conversions.