Current Unix Time
Converting...
Enter a timestamp above and click Convert
or use a quick-load preset, or click Use current time
What Is a Unix Timestamp?
A Unix timestamp is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC — a moment known as the Unix epoch. It is a signed 64-bit integer that counts forward (positive) into the future and backward (negative) into dates before 1970. Critically, Unix time does not count leap seconds, which means it stays in perfect lockstep with UTC wall-clock time without any special rules.
Unix timestamps are the universal language of date-time in software. Every major language and database stores or exposes time in this format. They are timezone-agnostic by definition — a single integer represents the same instant everywhere on Earth.
Seconds, Milliseconds, Microseconds, Nanoseconds
Different languages and systems use different granularities. This tool auto-detects the most likely unit based on the magnitude of the value so you never have to guess.
Seconds (s)
~10 digits — e.g. 1718459400
Python time.time(), PHP time(), Unix shell date +%s
Milliseconds (ms)
~13 digits — e.g. 1718459400000
JavaScript Date.now(), Java System.currentTimeMillis()
Microseconds (µs)
~16 digits — e.g. 1718459400000000
PostgreSQL EXTRACT(EPOCH ...)*1e6, C gettimeofday()
Nanoseconds (ns)
~19 digits — e.g. 1718459400000000000
Go time.Now().UnixNano(), Rust SystemTime
Date Format Reference
| Format | Example |
|---|---|
| ISO 8601 | 2024-06-15T14:30:00Z |
| RFC 2822 | Sat, 15 Jun 2024 14:30:00 +0000 |
| Long form | Saturday, June 15, 2024 at 2:30 PM |
| Short form | 06/15/2024 14:30:00 |
The Year 2038 Problem
32-bit signed integers can hold a maximum value of 2,147,483,647 — which corresponds to January 19, 2038, 03:14:07 UTC. At that moment, any system still using a 32-bit time_t will overflow to a large negative number, likely treating the date as December 1901. This is analogous to the Y2K bug.
Modern 64-bit systems are safe: a signed 64-bit timestamp won't overflow until the year 292,277,026,596. All modern operating systems, databases, and languages already use 64-bit time internally.
Common Reference Timestamps
| Event | Unix (s) |
|---|---|
| Unix Epoch | 0 |
| Y2K | 946684800 |
| 2038 Overflow | 2147483647 |
| Year 9999 end | 253402300799 |
Frequently Asked Questions
How do I get the current Unix timestamp in JavaScript?
Math.floor(Date.now() / 1000) Date.now() returns milliseconds since epoch. Divide by 1000 and floor to get seconds. Use Date.now() directly for millisecond precision.How do I convert a timestamp to a date in Python?
from datetime import datetime, timezone
datetime.fromtimestamp(1718459400, tz=timezone.utc) Always pass tz=timezone.utc to avoid silent local-timezone conversions. for millisecond timestamps divide by 1000 first: datetime.fromtimestamp(ts / 1000, tz=timezone.utc).How do I convert a Unix timestamp in SQL / MySQL?
-- MySQL / MariaDB
SELECT FROM_UNIXTIME(1718459400);
SELECT UNIX_TIMESTAMP('2024-06-15 14:30:00'); -- PostgreSQL
SELECT to_timestamp(1718459400);
SELECT EXTRACT(EPOCH FROM NOW())::BIGINT; PostgreSQL stores timestamps internally in microseconds; cast to BIGINT for a seconds value.What does a negative Unix timestamp mean?
-86400 is December 31, 1969 at 00:00:00 UTC. Most modern languages support negative timestamps. The minimum 64-bit value (-9223372036854775808) reaches back roughly 292 billion years.Are Unix timestamps affected by timezones?
How do I get the Unix timestamp in Go?
t := time.Now()
t.Unix() // seconds
t.UnixMilli() // milliseconds
t.UnixMicro() // microseconds
t.UnixNano() // nanoseconds All four methods are available from Go 1.17+. for the reverse, use time.Unix(sec, nsec) where nsec can be 0.