What is a Unix timestamp?
A Unix timestamp (also called Unix time, POSIX time or epoch time) is the number of seconds that have passed since 00:00:00 UTC on January 1, 1970. It is the same number everywhere in the world regardless of time zone, which is why servers, databases, logs and APIs use it to store points in time.
To show a timestamp as local time, add your time zone's offset from UTC. That offset can change during the year if your region observes daylight saving time; this converter uses your browser's time zone rules, so the result is always correct for the date in question.
Seconds or milliseconds?
- 10 digits (e.g. 1798000000) → seconds. Used by most servers and databases.
- 13 digits (e.g. 1798000000000) → milliseconds. JavaScript's
Date.now()and Java'sSystem.currentTimeMillis()return this. - 16 digits are microseconds and 19 digits are nanoseconds. Leave the unit on “Auto” and it is detected from the number of digits.
Get the current timestamp in code
// JavaScript Math.floor(Date.now() / 1000) # Python import time; int(time.time()) // Java System.currentTimeMillis() / 1000 // Go time.Now().Unix() -- MySQL SELECT UNIX_TIMESTAMP(); -- PostgreSQL SELECT EXTRACT(EPOCH FROM now())::bigint; # Shell (macOS, Linux) date +%s
FAQ
What is the Year 2038 problem?
Older systems that store timestamps as signed 32-bit integers overflow after 03:14:07 UTC on January 19, 2038 (value 2,147,483,647) and wrap around to 1901. Most modern systems use 64-bit integers and are not affected.
Can a timestamp be negative?
Yes. Times before 1970 are negative. For example, -86400 is 00:00 UTC on December 31, 1969.
Does Unix time include leap seconds?
No. Unix time ignores leap seconds and treats every day as exactly 86,400 seconds, so the result matches what most programs produce.