Current epoch — epochtime.tools · A precision instrument for time
Seconds —
Milliseconds —
Microseconds —
Open in converter

Updating ten times a second. Freeze to copy a single moment from every row.

ISO 8601 (UTC)—
RFC 2822—
Your local time—
Seconds to Y2038—

What the numbers mean

The current Unix timestamp is the number of seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds. It is the same everywhere on Earth at the same moment; timezones only change how it is displayed.

Microseconds come from your browser's high-resolution clock. Browsers deliberately round that clock (typically to between 5 and 100 microseconds) to protect against timing attacks, so the last digits are approximate. No nanosecond value is shown, because a browser can't measure one.

Get the current Unix timestamp in code

JavaScript

Math.floor(Date.now() / 1000)      // seconds
Date.now()                          // milliseconds

Python

import time
int(time.time())                    # seconds
time.time_ns()                      # nanoseconds

Go

time.Now().Unix()      // seconds
time.Now().UnixMilli() // milliseconds
time.Now().UnixNano()  // nanoseconds

Rust

use std::time::{SystemTime, UNIX_EPOCH};
SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs()

Java

Instant.now().getEpochSecond()  // seconds
System.currentTimeMillis()      // milliseconds

C#

DateTimeOffset.UtcNow.ToUnixTimeSeconds()
DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()

PHP

time();               // seconds
hrtime(true);         // nanoseconds, monotonic (not epoch)

Ruby

Time.now.to_i                          # seconds
Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)

Bash (GNU date)

date +%s      # seconds
date +%s%3N   # milliseconds
date +%s%N    # nanoseconds

PowerShell

[DateTimeOffset]::UtcNow.ToUnixTimeSeconds()

PostgreSQL

SELECT EXTRACT(EPOCH FROM now())::bigint;

MySQL

SELECT UNIX_TIMESTAMP();

To convert a timestamp you already have, use the epoch converter. To turn a calendar date into a timestamp, use date to timestamp.

Last updated: