What is a Unix Epoch Timestamp?
The Unix epoch (also called POSIX time or Unix time) represents the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC (Coordinated Universal Time), excluding leap seconds.
Unix timestamps provide a universal, timezone-agnostic integer representation of a specific instant in history. Because they are plain integers, computer programs can effortlessly compare, sort, and calculate time differences without parsing messy date strings or handling daylight saving time variations.
Seconds vs. Milliseconds vs. Microseconds
When working with APIs, databases, and programming languages, you will encounter timestamps in different resolutions:
- 10 Digits (Seconds): Standard Unix format used by Linux kernels, Python
time.time(), PHPtime(), and MySQLUNIX_TIMESTAMP(). Example:1735689600. - 13 Digits (Milliseconds): Standard format used by JavaScript (
Date.now()), Java (System.currentTimeMillis()), and modern web APIs. Example:1735689600000. - 16 Digits (Microseconds): Used by high-performance logging pipelines, Go microsecond timestamps, and time-series databases.
This tool automatically detects whether your input is in seconds or milliseconds and converts it accordingly.
Getting the Current Timestamp in Different Languages
JavaScript (Node.js & Browser)
// Seconds
const epochSeconds = Math.floor(Date.now() / 1000);
// Milliseconds
const epochMs = Date.now();
Python
import time
# Seconds (float converted to int)
epoch_seconds = int(time.time())
Go (Golang)
package main
import "time"
func main() {
epochSeconds := time.Now().Unix()
epochMs := time.Now().UnixMilli()
}
PHP
<?php
// Seconds
$epochSeconds = time();
?>
Bash / Linux Terminal
# Current epoch in seconds
date +%s
Privacy & Client-Side Execution
All timestamp and date conversions run locally inside your browser’s JavaScript engine. No timestamps, dates, or search queries are sent across the network.